Skip to content

Commit

Permalink
refactor: prettier ์ ์šฉ
Browse files Browse the repository at this point in the history
  • Loading branch information
GC-Park committed Aug 2, 2023
1 parent e8397a5 commit 21a5610
Show file tree
Hide file tree
Showing 30 changed files with 243 additions and 204 deletions.
1 change: 0 additions & 1 deletion frontend/src/components/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ const Map = (props: any, ref: any) => {
}
}, [clickedCoordinate]);


useEffect(() => {
// ๋งˆ์ปค๋“ค์„ ๋ชจ๋‘ ์ง€๋„์—์„œ ์ œ๊ฑฐ
if (markers.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/MergeOrSeeTogether/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const MergeOrSeeTogether = ({
onClickConfirm,
onClickClose,
}: MergeOrSeeTogetherProps) => {
if (tag.length === 0) return<></>;
if (tag.length === 0) return <></>;

return (
<>
Expand Down
13 changes: 5 additions & 8 deletions frontend/src/components/PinPreview/index.stories.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { StoryObj, Meta } from '@storybook/react';
import PinPreview from '.'
import PinPreview from '.';

const meta = {
title: 'Components/PinPreview',
Expand All @@ -14,10 +14,7 @@ export const PinPreviewComponent: Story = {
args: {
pinTitle: '์˜ค๋˜์ƒ์Šค์‹œ',
pinLocation: '์„œ์šธํŠน๋ณ„์‹œ ์„ ๋ฆ‰ ํ…Œํ—ค๋ž€๋กœ 192-46',
pinInformation: '์ดˆ๋ฐฅ์„ ํŒŒ๋Š” ๊ณณ์ž…๋‹ˆ๋‹ค. ์ ์‹ฌ ํŠน์„  ์žˆ๊ณ  ์ดˆ๋ฐฅ ์งˆ์ด ๊ดœ์ฐฎ์Šต๋‹ˆ๋‹ค. ๊ฐ€๊ฒฉ๋Œ€๋„ ๋‹ค๋ฅธ ๊ณณ์— ๋น„ํ•ด์„œ ์–‘ํ˜ธํ•œ ํŽธ์ด๊ณ  ์ ๋‹นํžˆ ์ƒ๊ฐ๋‚ ...',
}
}




pinInformation:
'์ดˆ๋ฐฅ์„ ํŒŒ๋Š” ๊ณณ์ž…๋‹ˆ๋‹ค. ์ ์‹ฌ ํŠน์„  ์žˆ๊ณ  ์ดˆ๋ฐฅ ์งˆ์ด ๊ดœ์ฐฎ์Šต๋‹ˆ๋‹ค. ๊ฐ€๊ฒฉ๋Œ€๋„ ๋‹ค๋ฅธ ๊ณณ์— ๋น„ํ•ด์„œ ์–‘ํ˜ธํ•œ ํŽธ์ด๊ณ  ์ ๋‹นํžˆ ์ƒ๊ฐ๋‚ ...',
},
};
4 changes: 3 additions & 1 deletion frontend/src/components/TopicCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ const TopicCard = ({
{topicTitle}
</Text>
<Text color="gray" $fontSize="small" $fontWeight="normal">
{`์—…๋ฐ์ดํŠธ : ${topicUpdatedAt.split('T')[0]} | ํ•€ ๊ฐœ์ˆ˜ : ${topicPinCount}`}
{`์—…๋ฐ์ดํŠธ : ${
topicUpdatedAt.split('T')[0]
} | ํ•€ ๊ฐœ์ˆ˜ : ${topicPinCount}`}
</Text>
</Flex>
</Flex>
Expand Down
17 changes: 8 additions & 9 deletions frontend/src/components/TopicInfo/index.stories.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { StoryObj, Meta } from "@storybook/react";
import TopicInfo from ".";
import { StoryObj, Meta } from '@storybook/react';
import TopicInfo from '.';

const meta = {
title: "Components/TopicInfo",
title: 'Components/TopicInfo',
component: TopicInfo,
tags: ["components"],
tags: ['components'],
} as Meta<typeof TopicInfo>;

export default meta;
Expand All @@ -14,9 +14,8 @@ export const TopicInfoComponent: Story = {
args: {
topicParticipant: 3,
pinNumber: 5,
topicTitle: "์„ ๋ฆ‰ ์ง์žฅ์ธ์ด ๊ฐ€๋Š” ๋ง›์ง‘",
topicOwner: "์˜ค๋˜์ƒ",
topicDescription: "์„ ๋ฆ‰ ์ง์žฅ์ธ์ด ๋Œ์•„๋‹ค๋‹ˆ๋ฉด์„œ ๊ธฐ๋กํ•œ ๋ง›์ง‘ ๋ฆฌ์ŠคํŠธ์˜ˆ์š”."
}
topicTitle: '์„ ๋ฆ‰ ์ง์žฅ์ธ์ด ๊ฐ€๋Š” ๋ง›์ง‘',
topicOwner: '์˜ค๋˜์ƒ',
topicDescription: '์„ ๋ฆ‰ ์ง์žฅ์ธ์ด ๋Œ์•„๋‹ค๋‹ˆ๋ฉด์„œ ๊ธฐ๋กํ•œ ๋ง›์ง‘ ๋ฆฌ์ŠคํŠธ์˜ˆ์š”.',
},
};

126 changes: 73 additions & 53 deletions frontend/src/components/common/Box/index.stories.ts
Original file line number Diff line number Diff line change
@@ -1,130 +1,150 @@
import { StoryObj, Meta } from "@storybook/react";
import Box from ".";
import { StoryObj, Meta } from '@storybook/react';
import Box from '.';

const meta = {
title: "Components/common/Box",
title: 'Components/common/Box',
component: Box,
tags: ["autodocs"],
tags: ['autodocs'],
argTypes: {
display: {
control: {
type: "select",
type: 'select',
},
options: ["flex", "block", "inline-block"],
defaultValue: "flex",
options: ['flex', 'block', 'inline-block'],
defaultValue: 'flex',
table: {
defaultValue: { summary: "flex" },
type: { summary: "flex | block | inline-block" },
defaultValue: { summary: 'flex' },
type: { summary: 'flex | block | inline-block' },
},
},
width: {
control: {
type: "text",
type: 'text',
},
defaultValue: "100%",
defaultValue: '100%',
table: {
defaultValue: { summary: "100%" },
type: { summary: "string" },
defaultValue: { summary: '100%' },
type: { summary: 'string' },
},
},
height: {
control: {
type: "text",
type: 'text',
},
defaultValue: "100%",
defaultValue: '100%',
table: {
defaultValue: { summary: "100%" },
type: { summary: "string" },
defaultValue: { summary: '100%' },
type: { summary: 'string' },
},
},
padding: {
control: {
type: "select",
type: 'select',
options: [0, 1, 2, 3, 4, 5, 6],
},
defaultValue: 0,
table: {
defaultValue: { summary: 0 },
type: { summary: "number" },
type: { summary: 'number' },
},
},
$backgroundColor: {
control: {
type: "radio",
},
options: ["primary", "black", "white", "darkGray", "gray", "lightGray", "whiteGray"],
defaultValue: "primary",
type: 'radio',
},
options: [
'primary',
'black',
'white',
'darkGray',
'gray',
'lightGray',
'whiteGray',
],
defaultValue: 'primary',
table: {
defaultValue: { summary: "primary" },
type: { summary: "primary | black | white | darkGray |gray | lightGray | whiteGray" },
defaultValue: { summary: 'primary' },
type: {
summary:
'primary | black | white | darkGray |gray | lightGray | whiteGray',
},
},
},
border: {
control: {
type: "select",
type: 'select',
},
options: ["none", "1px solid black"],
defaultValue: "none",
options: ['none', '1px solid black'],
defaultValue: 'none',
table: {
defaultValue: { summary: "none" },
type: { summary: "none | 1px solid black" },
defaultValue: { summary: 'none' },
type: { summary: 'none | 1px solid black' },
},
},
overflow: {
control: {
type: "select",
type: 'select',
},
options: ["visible", "hidden", "scroll", "auto"],
defaultValue: "visible",
options: ['visible', 'hidden', 'scroll', 'auto'],
defaultValue: 'visible',
table: {
defaultValue: { summary: "visible" },
type: { summary: "visible | hidden | scroll | auto" },
defaultValue: { summary: 'visible' },
type: { summary: 'visible | hidden | scroll | auto' },
},
},
color: {
control: {
type: "radio",
},
options: ["primary", "black", "white", "darkGray", "gray", "lightGray", "whiteGray"],
defaultValue: "primary",
type: 'radio',
},
options: [
'primary',
'black',
'white',
'darkGray',
'gray',
'lightGray',
'whiteGray',
],
defaultValue: 'primary',
table: {
defaultValue: { summary: "primary" },
type: { summary: "primary | black | white | darkGray |gray | lightGray | whiteGray" },
defaultValue: { summary: 'primary' },
type: {
summary:
'primary | black | white | darkGray |gray | lightGray | whiteGray',
},
},
},
$borderRadius: {
control: {
type: "radio",
type: 'radio',
},
options: ["small", "medium"],
defaultValue: "small",
options: ['small', 'medium'],
defaultValue: 'small',
table: {
defaultValue: { summary: "small" },
type: { summary: "small | medium" },
defaultValue: { summary: 'small' },
type: { summary: 'small | medium' },
},
},
children: {
control: {
type: "text",
type: 'text',
},
defaultValue: "Button",
defaultValue: 'Button',
table: {
defaultValue: { summary: "Button" },
type: { summary: "string" },
defaultValue: { summary: 'Button' },
type: { summary: 'string' },
},
},
},

} as Meta<typeof Box>;

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

//make a Default has background Color


export const Default: Story = {
args: {
children: "Box",
children: 'Box',
},
};
14 changes: 9 additions & 5 deletions frontend/src/components/common/Box/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ const Box = styled.div<BoxProps>`
$backgroundColor && theme.color[$backgroundColor]};
color: ${({ color }) => color && theme.color[color]};
padding: ${({ padding }) => padding && theme.spacing[Number(padding)]};
padding-top: ${({ $paddingTop }) => $paddingTop && theme.spacing[Number($paddingTop)]};
padding-right: ${({ $paddingRight }) => $paddingRight && theme.spacing[Number($paddingRight)]};
padding-bottom: ${({ $paddingBottom }) => $paddingBottom && theme.spacing[Number($paddingBottom)]};
padding-left: ${({ $paddingLeft }) => $paddingLeft && theme.spacing[Number($paddingLeft)]};
padding-top: ${({ $paddingTop }) =>
$paddingTop && theme.spacing[Number($paddingTop)]};
padding-right: ${({ $paddingRight }) =>
$paddingRight && theme.spacing[Number($paddingRight)]};
padding-bottom: ${({ $paddingBottom }) =>
$paddingBottom && theme.spacing[Number($paddingBottom)]};
padding-left: ${({ $paddingLeft }) =>
$paddingLeft && theme.spacing[Number($paddingLeft)]};
width: ${({ width }) => width};
min-width: ${({ $minWidth }) => $minWidth };
min-width: ${({ $minWidth }) => $minWidth};
height: ${({ height }) => height};
border: ${({ border }) => border};
min-height: ${({ $minHeight }) => $minHeight};
Expand Down
48 changes: 24 additions & 24 deletions frontend/src/components/common/Button/index.stories.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import { Meta, StoryObj } from "@storybook/react";
import Button from ".";
import { Meta, StoryObj } from '@storybook/react';
import Button from '.';

const meta = {
title: "Components/common/Button",
title: 'Components/common/Button',
component: Button,
tags: ["autodocs"],
tags: ['autodocs'],
argTypes: {
variant: {
control: {
type: "radio",
type: 'radio',
},
options: ["primary", "secondary"],
defaultValue: "primary",
options: ['primary', 'secondary'],
defaultValue: 'primary',
table: {
defaultValue: { summary: "primary" },
type: { summary: "primary | secondary" },
defaultValue: { summary: 'primary' },
type: { summary: 'primary | secondary' },
},
},
children: {
control: {
type: "text",
type: 'text',
},
defaultValue: "Button",
defaultValue: 'Button',
table: {
defaultValue: { summary: "Button" },
type: { summary: "string" },
defaultValue: { summary: 'Button' },
type: { summary: 'string' },
},
},
disabled: {
control: {
type: "boolean",
type: 'boolean',
},
defaultValue: false,
description: "๋ฒ„ํŠผ ๋น„ํ™œ์„ฑํ™” ์—ฌ๋ถ€",
description: '๋ฒ„ํŠผ ๋น„ํ™œ์„ฑํ™” ์—ฌ๋ถ€',
table: {
defaultValue: { summary: false },
type: { summary: "boolean" },
type: { summary: 'boolean' },
},
},
onClick: {
description: "๋ฒ„ํŠผ ํด๋ฆญ ์ด๋ฒคํŠธ",
description: '๋ฒ„ํŠผ ํด๋ฆญ ์ด๋ฒคํŠธ',
table: {
type: { summary: "function" },
type: { summary: 'function' },
},
},
},
Expand All @@ -52,22 +52,22 @@ type Story = StoryObj<typeof meta>;

export const Primary: Story = {
args: {
variant: "primary",
children: "primary button",
variant: 'primary',
children: 'primary button',
},
};

export const Secondary: Story = {
args: {
variant: "secondary",
children: "secondary button",
variant: 'secondary',
children: 'secondary button',
},
};

export const Disabled: Story = {
args: {
variant: "primary",
children: "disabled button",
variant: 'primary',
children: 'disabled button',
disabled: true,
},
};
Loading

0 comments on commit 21a5610

Please sign in to comment.