Skip to content

Commit

Permalink
refactor: 컴포넌트들 스토리북 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ccwnc committed Apr 17, 2024
1 parent e974629 commit 3be8f2e
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 55 deletions.
5 changes: 2 additions & 3 deletions src/components/AlarmList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { RefObject } from 'react';

import classNames from 'classnames/bind';

import AlarmCard from '@/components/cards/AlarmCard';
import EmptyAlarm from '@/components/cards/EmptyAlarmCard';
import { AlarmCard, EmptyAlarmCard } from '../cards';

import styles from './AlarmList.module.scss';

Expand Down Expand Up @@ -57,7 +56,7 @@ const AlarmList = ({
))}
</ul>
) : (
<EmptyAlarm emptyAlarmText={emptyAlarmText} />
<EmptyAlarmCard emptyAlarmText={emptyAlarmText} />
)}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/stories/Alarm.stories.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Alarm from '@/components/header/Alarm';
import Alarm from '@/components/Alarm';

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'header/Alarm',
title: 'Alarm/Alarm',
component: Alarm,
} satisfies Meta<typeof Alarm>;

Expand Down
8 changes: 4 additions & 4 deletions src/stories/AlarmCard.stories.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import AlarmCard from '@/components/header/AlarmCard';
import { AlarmCard } from '@/components/cards';

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'header/AlarmList/AlarmCard',
title: 'Cards/AlarmCard',
component: AlarmCard,
} satisfies Meta<typeof AlarmCard>;

Expand All @@ -13,8 +13,8 @@ type Story = StoryObj<typeof meta>;
export const Example: Story = {
args: {
id: 0,
content: '함께하면 즐거운 스트릿 댄스(2024-04-16 15:00~18:00) 예약이 승인되었어요.',
createdAt: '30분 전',
content: 'message',
createdAt: '1 hour age',
onClick: () => {},
},
};
10 changes: 6 additions & 4 deletions src/stories/AlarmList.stories.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import AlarmList from '@/components/header/AlarmList';
import AlarmList from '@/components/AlarmList';

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'header/AlarmList',
title: 'AlarmList/AlarmList',
component: AlarmList,
} satisfies Meta<typeof AlarmList>;

Expand All @@ -12,11 +12,13 @@ type Story = StoryObj<typeof meta>;

export const Example: Story = {
args: {
alarmText: 'Alarm',
deleteAllText: 'Delete All',
notifications: [
{
id: 0,
content: '함께하면 즐거운 스트릿 댄스(2024-04-16 15:00~18:00) 예약이 승인되었어요.',
createdAt: '30분 전',
content: 'messag ',
createdAt: '1 hour age',
},
],
totalCount: 1,
Expand Down
11 changes: 8 additions & 3 deletions src/stories/DrawerMenu.stories.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import DrawerMenu from '@/components/header/DrawerMenu';
import DrawerMenu from '@/components/DrawerMenu';

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'header/DrawerMenu',
title: 'DrawerMenu/DrawerMenu',
component: DrawerMenu,
} satisfies Meta<typeof DrawerMenu>;

Expand All @@ -12,7 +12,12 @@ type Story = StoryObj<typeof meta>;

export const Example: Story = {
args: {
menuList: ['LEAGUE OF LEGENDS', 'BATTLEGROUNDS', 'OVERWATCH 2', 'MINECRAFT'],
menuList: [
{ menu: 'LEAGUE OF LEGENDS', path: 'lol' },
{ menu: 'BATTLEGROUNDS', path: 'bg' },
{ menu: 'OVERWATCH 2', path: 'ow' },
{ menu: 'MINECRAFT', path: 'mc' },
],
onClick: () => {},
},
};
17 changes: 0 additions & 17 deletions src/stories/EmptyAlarm.stories.ts

This file was deleted.

17 changes: 17 additions & 0 deletions src/stories/EmptyAlarmCard.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { EmptyAlarmCard } from '@/components/cards';

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'Cards/EmptyAlarmCard',
component: EmptyAlarmCard,
} satisfies Meta<typeof EmptyAlarmCard>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Example: Story = {
args: {
emptyAlarmText: 'There is no alarm',
},
};
17 changes: 11 additions & 6 deletions src/stories/Header.stories.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Header from '@/components/header/Header';
import Header from '@/components/Header';

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'header/Header',
title: 'Header/Header',
component: Header,
} satisfies Meta<typeof Header>;

Expand All @@ -13,10 +13,15 @@ type Story = StoryObj<typeof meta>;
export const Example: Story = {
args: {
path: '',
logoName: 'GGF',
menuList: ['LEAGUE OF LEGENDS', 'BATTLEGROUNDS', 'OVERWATCH 2', 'MINECRAFT'],
activatedGame: 0,
handleActivatedGame: () => {},
logoName: 'LOGO',
menuList: [
{ menu: 'MENU 1', path: 'menu1' },
{ menu: 'MENU 2', path: 'menu2' },
{ menu: 'MENU 3', path: 'menu3' },
{ menu: 'MENU 4', path: 'menu4' },
],
activatedMenu: 0,
handleActivatedMenu: () => {},
handleOpenDrawerMenu: () => {},
},
};
6 changes: 3 additions & 3 deletions src/stories/HeaderProfile.stories.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import HeaderProfile from '@/components/header/HeaderProfile';
import HeaderProfile from '@/components/HeaderProfile';

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'header/HeaderProfile',
title: 'HeaderProfile/HeaderProfile',
component: HeaderProfile,
} satisfies Meta<typeof HeaderProfile>;

Expand All @@ -12,7 +12,7 @@ type Story = StoryObj<typeof meta>;

export const Example: Story = {
args: {
nickname: 'BattleMan',
nickname: 'UserName',
profileImageUrl: '',
isActivated: false,
onClick: () => {},
Expand Down
5 changes: 3 additions & 2 deletions src/stories/HeaderSigninButton.stories.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HeaderSigninButton } from '@/components/header/buttons';
import { HeaderSigninButton } from '@/components/buttons';

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'header/buttons/HeaderSigninButton',
title: 'buttons/HeaderSigninButton',
component: HeaderSigninButton,
} satisfies Meta<typeof HeaderSigninButton>;

Expand All @@ -12,6 +12,7 @@ type Story = StoryObj<typeof meta>;

export const Example: Story = {
args: {
text: 'SIGNIN',
path: '',
},
};
5 changes: 3 additions & 2 deletions src/stories/HeaderSignupButton.stories.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HeaderSignupButton } from '@/components/header/buttons';
import { HeaderSignupButton } from '@/components/buttons';

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'header/buttons/HeaderSignupButton',
title: 'buttons/HeaderSignupButton',
component: HeaderSignupButton,
} satisfies Meta<typeof HeaderSignupButton>;

Expand All @@ -12,6 +12,7 @@ type Story = StoryObj<typeof meta>;

export const Example: Story = {
args: {
text: 'SIGNUP',
path: '',
},
};
15 changes: 10 additions & 5 deletions src/stories/Menu.stories.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Menu from '@/components/header/Menu';
import Menu from '@/components/Menu';

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'header/Menu',
title: 'Menu/Menu',
component: Menu,
} satisfies Meta<typeof Menu>;

Expand All @@ -12,8 +12,13 @@ type Story = StoryObj<typeof meta>;

export const Example: Story = {
args: {
menuList: ['LEAGUE OF LEGENDS', 'BATTLEGROUNDS', 'OVERWATCH 2', 'MINECRAFT'],
activatedGame: 0,
handleActivatedGame: () => {},
menuList: [
{ menu: 'MENU 1', path: 'menu1' },
{ menu: 'MENU 2', path: 'menu2' },
{ menu: 'MENU 3', path: 'menu3' },
{ menu: 'MENU 4', path: 'menu4' },
],
activatedMenu: 0,
handleActivatedMenu: () => {},
},
};
10 changes: 6 additions & 4 deletions src/stories/UserMenu.stories.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import UserMenu from '@/components/header/UserMenu';
import UserMenu from '@/components/UserMenu';

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'header/UserMenu',
title: 'UserMenu/UserMenu',
component: UserMenu,
} satisfies Meta<typeof UserMenu>;

Expand All @@ -13,8 +13,10 @@ type Story = StoryObj<typeof meta>;
export const Example: Story = {
args: {
profileImageUrl: '',
nickname: 'BattleMan',
email: 'BattleMan@gmail.com',
nickname: 'username',
email: 'user@email.com',
mypageText: 'My Page',
logoutText: 'Logout',
accountPath: '',
mypagePath: '',
handleCloseUserMenu: () => {},
Expand Down

0 comments on commit 3be8f2e

Please sign in to comment.