-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into setting/#382
- Loading branch information
Showing
4 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import { IconHamburger } from '@public/icons'; | ||
import TopHeader from '@/ui/Base/TopHeader'; | ||
|
||
const meta: Meta<typeof TopHeader> = { | ||
title: 'Base/TopHeader', | ||
component: TopHeader, | ||
tags: ['autodocs'], | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof TopHeader>; | ||
|
||
const TopHeaderWithMenu = () => { | ||
return ( | ||
<TopHeader label="Profile"> | ||
<button | ||
onClick={() => { | ||
alert('HAMBURGUR MENU!🍔'); | ||
}} | ||
> | ||
<IconHamburger width={20} height={20} alt="햄버거메뉴" /> | ||
</button> | ||
</TopHeader> | ||
); | ||
}; | ||
|
||
export const Default: Story = { | ||
args: { label: 'BookArchive' }, | ||
}; | ||
|
||
export const Menu: Story = { | ||
render: () => <TopHeaderWithMenu />, | ||
}; |
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 @@ | ||
import { ReactNode } from 'react'; | ||
|
||
interface TopHeaderProps { | ||
label: string; | ||
children?: ReactNode; | ||
} | ||
|
||
const TopHeader = ({ label, children }: TopHeaderProps) => { | ||
return ( | ||
<div className="flex items-center justify-between px-[2rem] pb-[0.8rem] pt-[2rem]"> | ||
<p className="text-xl font-bold text-main-900">{label}</p> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
export default TopHeader; |