Skip to content

Commit

Permalink
feat: top bar logo 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hae-on committed Apr 13, 2024
1 parent db1e2ed commit 85bfbeb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/Common/TopBar/TopBar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ export const Default: Story = {
},
};

export const Logo: Story = {
render: (args) => {
return (
<TopBar {...args}>
<TopBar.Logo />
<TopBar.SearchLink />
</TopBar>
);
},
};

export const CenterTitleAndSearch: Story = {
render: (args) => {
return (
Expand Down
11 changes: 11 additions & 0 deletions src/components/Common/TopBar/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import { LeftNavigationWrapper, container, headerTitle, leftTitle } from './topB
import SvgIcon from '../Svg/SvgIcon';
import Text from '../Text/Text';

import LogoImage from '@/assets/logo.svg';
import { PATH } from '@/constants/path';
import { vars } from '@/styles/theme.css';


interface TopBarProps {
children?: React.ReactNode;
title?: string;
Expand All @@ -18,6 +20,14 @@ const TopBar = ({ children }: TopBarProps) => {
return <header className={container}>{children}</header>;
};

const Logo = () => {
return (
<Link to={PATH.HOME}>
<LogoImage width={120} />
</Link>
);
};

const BackLink = ({ state }: TopBarProps) => {
return (
<Link to=".." relative="path" state={state}>
Expand Down Expand Up @@ -70,6 +80,7 @@ const Spacer = () => {
return <div style={{ width: 24, height: 24 }} aria-hidden />;
};

TopBar.Logo = Logo;
TopBar.BackLink = BackLink;
TopBar.LeftNavigationGroup = LeftNavigationGroup;
TopBar.Title = Title;
Expand Down

0 comments on commit 85bfbeb

Please sign in to comment.