Skip to content

Commit

Permalink
refactor: Card 컴포넌트 들 디렉토리 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-yn committed Jun 30, 2024
1 parent 9046dee commit ab44543
Show file tree
Hide file tree
Showing 33 changed files with 33 additions and 34 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import classNames from 'classnames';
import React, { PropsWithChildren } from 'react';
import Tag, { ExcludedTags } from '@/composable/Tag/Tag';
import { bgColorVariants, cardStyle } from './CommonCard.css';
import { bgColorVariants, cardStyle } from './Card.css';

interface Props {
className?: string;
Expand All @@ -10,7 +10,7 @@ interface Props {
onClick?: () => void;
}

const CommonCard = ({
const Card = ({
children,
as,
className,
Expand All @@ -32,4 +32,4 @@ const CommonCard = ({
);
};

export default React.memo(CommonCard);
export default React.memo(Card);
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import classNames from 'classnames';
import React, { PropsWithChildren } from 'react';
import { getStaticContext } from '@/utils/context/StaticContext';
import CommonCard from '../Common/CommonCard';
import Card from '../Card/Card';
import StaticContextHistoryCard, {
HistoryCardContextProps,
} from './HistoryCard.context';
Expand Down Expand Up @@ -43,7 +43,7 @@ const HistoryCard = ({
period,
}}
>
<CommonCard
<Card
as="button"
className={classNames(
className,
Expand All @@ -54,7 +54,7 @@ const HistoryCard = ({
onClick={onClick}
>
{children}
</CommonCard>
</Card>
</StaticContextHistoryCard.Provider>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/HistoryCarousel/HistoryCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import React, { useEffect, useRef } from 'react';
import { useSwiper } from 'swiper/react';
import HistoryDetailCard, {
HistoryDetailCardProps,
} from '@/components/Card/History/Detail/HistoryDetailCard';
} from '@/components/HistoryDetailCard/HistoryDetailCard';
import HistoryImpactCard, {
HistoryImpactCardProps,
} from '@/components/Card/History/Impact/HistoryImpactCard';
} from '@/components/HistoryImpactCard/HistoryImpactCard';
import OceanSwiper from '@/components/OceanSwiper/OceanSwiper';
import Button from '@/composable/Button/Button';
import CommonIcon from '@/composable/Icon/CommonIcon';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { PropsWithChildren } from 'react';
import MarkdownViewer from '@/components/MarkdownViewer/MarkdownViewer';
import CommonIcon from '@/composable/Icon/CommonIcon';
import { getStaticContext } from '@/utils/context/StaticContext';
import CommonCard from '../../Common/CommonCard';
import Card from '../Card/Card';
import StaticContextHistoryDetailCard, {
HistoryDetailContextProps,
} from './HistoryDetailCard.context';
Expand Down Expand Up @@ -52,15 +52,15 @@ const HistoryDetailCard = ({
content,
}}
>
<CommonCard
<Card
className={classNames(
className,
sizeToken ? wrapVariants[sizeToken] : wrapStyle,
)}
bgColorToken="GRAY"
>
{children}
</CommonCard>
</Card>
</StaticContextHistoryDetailCard.Provider>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import CommonIcon from '@/composable/Icon/CommonIcon';
import { StaticContextUserInfo } from '@/Provider/UserInfoProvider.context';
import { getStaticContext } from '@/utils/context/StaticContext';
import calcRemToPxNumber from '@/utils/style/calcRemToPxNumber';
import CommonCard from '../../Common/CommonCard';
import Card from '../Card/Card';
import {
HistoryImpactContextProps,
StaticContextHistoryImpactCard,
Expand Down Expand Up @@ -47,15 +47,15 @@ const HistoryImpactCard = ({
content,
}}
>
<CommonCard
<Card
className={classNames(
className,
sizeToken ? wrapStyleVariants[sizeToken] : wrapStyle,
)}
bgColorToken="USER"
>
{children}
</CommonCard>
</Card>
</StaticContextHistoryImpactCard.Provider>
);
};
Expand Down
6 changes: 3 additions & 3 deletions src/components/HistorySummary/HistorySummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import React, {
useContext,
useState,
} from 'react';
import HistoryCard from '@/components/Card/History/HistoryCard';
import { HistoryCardContextProps } from '@/components/Card/History/HistoryCard.context';
import HistoryCard from '@/components/HistoryCard/HistoryCard';
import { HistoryCardContextProps } from '@/components/HistoryCard/HistoryCard.context';
import {
defaultCardWidthStyle,
detailViewCardWidthStyle,
} from '@/components/Card/History/HistoryCard.css';
} from '@/components/HistoryCard/HistoryCard.css';
import Button from '@/composable/Button/Button';
import CommonIcon from '@/composable/Icon/CommonIcon';
import Pagination from '@/composable/Pagination/Pagination';
Expand Down
2 changes: 1 addition & 1 deletion src/components/NormalProject/NormalProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import {
import { createNestedArray } from '@/utils/array/createNestedArray';
import { getPeriod } from '@/utils/date/getPeriod';
import { getCurrentBreakPoints } from '@/utils/layout/getCurrentBreakPoints';
import ProjectCard from '../Card/Project/ProjectCard';
import OceanSwiper from '../OceanSwiper/OceanSwiper';
import { ProjectContextData } from '../Project/Project.context';
import ProjectCard from '../ProjectCard/ProjectCard';
import {
ContextDispatchNormalProject,
ContextValueNormalProject,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/SkillList/SkillList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import Button from '@/composable/Button/Button';
import CommonIcon from '@/composable/Icon/CommonIcon';
import Spacer from '@/composable/Spacer/Spacer';
import { getStaticContext } from '@/utils/context/StaticContext';
import SkillCard from '../Card/Skill/SkillCard';
import {
DispatcherContextSkill,
StaticContextSkill,
ValueContextSkill,
} from '../Skill/Skill.context';
import SkillCard from '../SkillCard/SkillCard';
import {
bundleStyle,
buttonStyle,
Expand Down
2 changes: 1 addition & 1 deletion src/components/SkillSlide/SkillSlide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { useReactiveLayout } from '@/hook/useReactiveLayout';
import { W100 } from '@/styles/common/layout.css';
import { createNestedArray } from '@/utils/array/createNestedArray';
import { getStaticContext } from '@/utils/context/StaticContext';
import SkillCard from '../Card/Skill/SkillCard';
import OceanSwiper from '../OceanSwiper/OceanSwiper';
import { StaticContextSkill } from '../Skill/Skill.context';
import SkillCard from '../SkillCard/SkillCard';
import TextTab from '../TextTab/TextTab';
import TextTabGroup from '../TextTabGroup/TextTabGroup';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/containers/HistoryCarouselContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import { useSuspenseQuery } from '@apollo/client';
import classNames from 'classnames';
import { useContext } from 'react';
import HistoryDetailCard from '@/components/Card/History/Detail/HistoryDetailCard';
import { ValueContextHistory } from '@/components/History/History.context';
import HistoryCarousel from '@/components/HistoryCarousel/HistoryCarousel';
import HistoryDetailCard from '@/components/HistoryDetailCard/HistoryDetailCard';
import Button from '@/composable/Button/Button';
import Spacer from '@/composable/Spacer/Spacer';
import { GET_HISTORY_ITEM_BY_HISTORY_ID } from '@/gql/queries/history_item';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Meta, StoryObj } from '@storybook/react';
import HistoryCard, {
HistoryCardProps,
} from '@/components/Card/History/HistoryCard';
} from '@/components/HistoryCard/HistoryCard';
import { backgroundColorVariants } from '@/styles/common/color.css';

const meta: Meta<typeof HistoryCard> = {
title: 'Components/Card/History/HistoryCard',
title: 'Components/HistoryCard',
component: HistoryCard,
tags: ['autodocs'],
parameters: { layout: 'fullscreen' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import HistoryCarousel from '@/components/HistoryCarousel/HistoryCarousel';
import UserInfoProvider from '@/Provider/UserInfoProvider';

const meta: Meta<typeof HistoryCarousel> = {
title: 'Components/History/Carousel',
title: 'Components/HistoryCarousel',
component: HistoryCarousel,
tags: ['autodocs'],
parameters: { layout: 'fullscreen' },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Meta, StoryObj } from '@storybook/react';
import HistoryDetailCard, {
HistoryDetailCardProps,
} from '@/components/Card/History/Detail/HistoryDetailCard';
} from '@/components/HistoryDetailCard/HistoryDetailCard';

const Template = (args: HistoryDetailCardProps) => (
<HistoryDetailCard {...args}>
Expand All @@ -11,7 +11,7 @@ const Template = (args: HistoryDetailCardProps) => (
);

const meta: Meta<typeof HistoryDetailCard> = {
title: 'Components/Card/History/Detail/HistoryDetailCard',
title: 'Components/HistoryDetailCard',
component: Template,
tags: ['autodocs'],
parameters: { layout: 'fullscreen' },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Meta, StoryObj } from '@storybook/react';
import HistoryImpactCard, {
HistoryImpactCardProps,
} from '@/components/Card/History/Impact/HistoryImpactCard';
} from '@/components/HistoryImpactCard/HistoryImpactCard';
import UserInfoProvider from '@/Provider/UserInfoProvider';

const Template = (args: HistoryImpactCardProps) => (
Expand All @@ -12,7 +12,7 @@ const Template = (args: HistoryImpactCardProps) => (
);

const meta: Meta<typeof HistoryImpactCard> = {
title: 'Components/Card/History/Impact/HistoryImpactCard',
title: 'Components/HistoryImpactCard',
component: Template,
tags: ['autodocs'],
parameters: { layout: 'fullscreen' },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Meta, StoryObj } from '@storybook/react';
import { Suspense } from 'react';
import { StaticContextPageInfo } from '@/app/context';
import HistoryCarousel from '@/components/HistoryCarousel/HistoryCarousel';
import HistorySummary, {
HistorySummaryProps,
Expand Down Expand Up @@ -116,7 +115,7 @@ const CarouselTemplate = () => {
};

const meta: Meta<typeof Template> = {
title: 'Components/History/Summary',
title: 'Components/HistorySummary',
component: Template,
tags: ['autodocs'],
parameters: { layout: 'fullscreen' },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Meta, StoryObj } from '@storybook/react';
import ProjectCard, {
ProjectCardProps,
} from '@/components/Card/Project/ProjectCard';
} from '@/components/ProjectCard/ProjectCard';
import { jaeyoonColorTheme } from '@/styles/theme/jaeyoon.css';
import { sungyeonColorTheme } from '@/styles/theme/sungyeon.css';
import { yejiColorTheme } from '@/styles/theme/yeji.css';

const meta: Meta<typeof ProjectCard> = {
title: 'Components/Card/ProjectCard',
title: 'Components/ProjectCard',
component: ProjectCard,
tags: ['autodocs'],
parameters: { layout: 'fullscreen' },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Meta, StoryObj } from '@storybook/react';
import SkillCard from '@/components/Card/Skill/SkillCard';
import SkillCard from '@/components/SkillCard/SkillCard';
import { backgroundColorVariants } from '@/styles/common/color.css';

const meta: Meta<typeof SkillCard> = {
title: 'Components/Card/SkillCard',
title: 'Components/SkillCard',
component: SkillCard,
tags: ['autodocs'],
parameters: { layout: 'fullscreen' },
Expand Down

0 comments on commit ab44543

Please sign in to comment.