Skip to content

Commit

Permalink
Merge branch 'main' into setting/#382
Browse files Browse the repository at this point in the history
  • Loading branch information
hanyugeon committed Jul 25, 2023
2 parents 83e0af2 + 5aef81d commit 2fc87a0
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
File renamed without changes.
2 changes: 1 addition & 1 deletion public/icons/legacy/more.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions src/stories/Base/TopHeader.stories.tsx
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 />,
};
17 changes: 17 additions & 0 deletions src/ui/Base/TopHeader.tsx
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;

0 comments on commit 2fc87a0

Please sign in to comment.