Skip to content

Commit

Permalink
#45 feat: TermPage 라우터 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
wuzoo committed Jul 9, 2024
1 parent 611e0e9 commit 6ebf6a1
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/common/asset/svg/check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/common/asset/svg/check_active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/common/router/Router.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import App from '@/App';
import TermPage from '@/page/signIn/index/TermPage';

import { RouterProvider, createBrowserRouter } from 'react-router-dom';

Expand All @@ -11,7 +12,7 @@ const router = createBrowserRouter([
{ path: 'archiving', element: <p>archiving</p> },
{
path: 'signin',
element: <p>terms</p>,
element: <TermPage />,
},
{
path: 'signin/info',
Expand Down
12 changes: 12 additions & 0 deletions src/page/signIn/info/InfoFormPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Flex from '@/common/component/Flex/Flex';
import Heading from '@/common/component/Heading/Heading';

const InfoFormPage = () => {
return (
<Flex>
<Heading>회원가입</Heading>
</Flex>
);
};

export default InfoFormPage;
42 changes: 42 additions & 0 deletions src/story/page/signIn/TermArea.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import TermArea from '@/page/signIn/index/component/TermArea/TermArea';
import type { Meta, StoryObj } from '@storybook/react';

import { useState } from 'react';

const meta = {
title: 'page/signIn/TermArea',
component: TermArea,
parameters: {
layout: 'centered',
},
decorators: [
(Story) => (
<div css={{ width: '40rem' }}>
<Story />
</div>
),
],
args: {
term: '이용 약관',
isChecked: false,
},
} satisfies Meta<typeof TermArea>;

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

export const Default: Story = {
render: (args) => {
const [isClicked, setIsClicked] = useState(false);

const handleCheck = () => {
setIsClicked((prev) => !prev);
};

return (
<TermArea {...args} onClick={handleCheck} isChecked={isClicked} isRequired>
이용약관
</TermArea>
);
},
};
15 changes: 15 additions & 0 deletions src/story/page/signIn/TermPage.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import TermPage from '@/page/signIn/index/TermPage';
import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'page/signIn/TermPage',
component: TermPage,
parameters: {
layout: 'centered',
},
} satisfies Meta<typeof TermPage>;

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

export const Default: Story = {};
31 changes: 31 additions & 0 deletions src/story/page/signIn/TermsAgreeButton.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import TermsAgreeButton from '@/page/signIn/index/component/TermsAgreeButton/TermsAgreeButton';
import type { Meta, StoryObj } from '@storybook/react';

import { useState } from 'react';

const meta = {
title: 'page/signIn/TermsAgreeButton',
component: TermsAgreeButton,
parameters: {
layout: 'centered',
},
decorators: [
(Story) => (
<div css={{ width: '40rem' }}>
<Story />
</div>
),
],
args: {},
} satisfies Meta<typeof TermsAgreeButton>;

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

export const Default: Story = {
render: () => {
const [isClicked, setIsClicked] = useState(false);

return <TermsAgreeButton onClick={() => setIsClicked((prev) => !prev)} isClicked={isClicked} />;
},
};

0 comments on commit 6ebf6a1

Please sign in to comment.