Skip to content

Commit

Permalink
헤더 스타일 수정, storybook context 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
dongoc committed Aug 1, 2024
1 parent e42c764 commit 90b8181
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
17 changes: 11 additions & 6 deletions packages/public-header/src/public-header.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import type { Meta, StoryFn, StoryObj } from '@storybook/react'
import { appWithTranslation } from '@titicaca/next-i18next'
import { SessionContextProvider } from '@titicaca/react-contexts'
import {
HistoryProvider,
SessionContextProvider,
} from '@titicaca/react-contexts'

import { koCommonWeb } from '../../i18n/src/assets/ko/common-web'
import { jaCommonWeb } from '../../i18n/src/assets/ja/common-web'
Expand Down Expand Up @@ -54,14 +57,16 @@ export default {
country: 'KR',
lang: 'ko',
unregister: false,
photo: '',
photo: 'https://assets.triple.guide/images/ico-default-profile.svg',
mileage: { badges: [], level: 1, point: 0 },
uid: 'random-user',
email: '',
email: '[email protected]',
},
}}
>
<Story />
<HistoryProvider isPublic isAndroid={false}>
<Story />
</HistoryProvider>
</SessionContextProvider>
),
],
Expand All @@ -70,13 +75,13 @@ export default {
export const Basic: StoryObj<typeof PublicHeader> = {
args: {
disableAutoHide: true,
disableSideMenu: true,
},
}

export const SideMenu: StoryObj<typeof PublicHeader> = {
export const WithSideMenu: StoryObj<typeof PublicHeader> = {
args: {
disableAutoHide: true,
hasSideMenu: true,
},
}
export const Categories: StoryFn<typeof PublicHeader> = () => {
Expand Down
28 changes: 14 additions & 14 deletions packages/public-header/src/public-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,21 +198,21 @@ export function PublicHeader({
<ExtraActionItem href={linkHref} onClick={onLinkClick || onClick}>
{linkLabel ?? t(['nae-yeyag', '내 예약'])}
</ExtraActionItem>
</ExtraActionsContainer>

{deeplinkPath ? (
<PublicHeaderDeeplink
deeplinkPath={deeplinkPath}
DeeplinkComponent={DeeplinkComponent}
/>
) : null}

{hasSideMenu ? (
<HeaderMenuButton
onClick={onMenuButtonClick}
hasNewNotification={hasNewNotification}
/>
) : null}
{deeplinkPath ? (
<PublicHeaderDeeplink
deeplinkPath={deeplinkPath}
DeeplinkComponent={DeeplinkComponent}
/>
) : null}

{hasSideMenu ? (
<HeaderMenuButton
onClick={onMenuButtonClick}
hasNewNotification={hasNewNotification}
/>
) : null}
</ExtraActionsContainer>
</HeaderFrame>
</Wrapper>

Expand Down

0 comments on commit 90b8181

Please sign in to comment.