-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat: TopBar 추가
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
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,40 @@ | ||
import { useRouter } from 'next/navigation'; | ||
import Typography from '../Typography'; | ||
import { ArrowLeftIcon } from '@/icons'; | ||
import type { ComponentProps, ReactNode } from 'react'; | ||
|
||
export const BackButton = () => { | ||
const router = useRouter(); | ||
|
||
return ( | ||
<button type="button" onClick={() => router.back()}> | ||
<ArrowLeftIcon className="w-6 h-6" /> | ||
</button> | ||
); | ||
}; | ||
|
||
type TopBarProps = { | ||
LeftIcon1?: ReactNode; | ||
LeftIcon2?: ReactNode; | ||
RightIcon1?: ReactNode; | ||
RightIcon2?: ReactNode; | ||
title: string; | ||
} & ComponentProps<'header'>; | ||
|
||
export const TopBar = ({ LeftIcon1, LeftIcon2, RightIcon1, RightIcon2, title, ...props }: TopBarProps) => { | ||
return ( | ||
<header className="flex items-center justify-between h-[52px] px-4 gap-x-4 bg-white z-10" {...props}> | ||
<div className="flex items-center gap-x-4 w-[62px]"> | ||
{LeftIcon1} | ||
{LeftIcon2} | ||
</div> | ||
<Typography as="h1" variant="Title20px" color="grey900" className="flex-1 text-center"> | ||
{title} | ||
</Typography> | ||
<div className="flex items-center justify-end gap-x-4 w-[62px]"> | ||
{RightIcon2} | ||
{RightIcon1} | ||
</div> | ||
</header> | ||
); | ||
}; |
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 @@ | ||
export * from './TopBar'; |
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 @@ | ||
export { default as ArrowLeftIcon } from '@/icons/ArrowLeft.svg'; |