-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: navbar compound 패턴 코드 예시 추가
- Loading branch information
Showing
7 changed files
with
134 additions
and
7 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.NavbarV2 { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
width: 100%; | ||
height: 2.75rem; | ||
padding: 0.75rem 1.25rem; | ||
background-color: var(--color-white); | ||
|
||
button { | ||
display: flex; | ||
} | ||
} | ||
|
||
.RightButton { | ||
margin-left: auto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import type { ButtonHTMLAttributes, PropsWithChildren } from "react"; | ||
|
||
import classNames from "classnames"; | ||
|
||
import styles from "@/components/ui/NavbarV2/NavbarV2.module.scss"; | ||
|
||
const NavbarV2 = ({ children }: PropsWithChildren) => { | ||
return <div className={styles.NavbarV2}>{children}</div>; | ||
}; | ||
|
||
NavbarV2.LeftButton = ({ | ||
children, | ||
// 확장성 고려해서 className 추가 현재 디자인상에서는 사실 필요 없기는 함 | ||
className, | ||
...props | ||
}: ButtonHTMLAttributes<HTMLButtonElement>) => { | ||
return ( | ||
<button {...props} className={className}> | ||
{children} | ||
</button> | ||
); | ||
}; | ||
|
||
NavbarV2.RightButton = ({ | ||
children, | ||
className, | ||
...props | ||
}: ButtonHTMLAttributes<HTMLButtonElement>) => { | ||
return ( | ||
<button className={classNames(styles.RightButton, className)} {...props}> | ||
{children} | ||
</button> | ||
); | ||
}; | ||
|
||
export default NavbarV2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters