diff --git a/src/components/common/category-chip/index.tsx b/src/components/common/category-chip/index.tsx index 4a8889e..7bc55c9 100644 --- a/src/components/common/category-chip/index.tsx +++ b/src/components/common/category-chip/index.tsx @@ -15,7 +15,7 @@ function CategoryChip({ category }: Props) { + variant='Label1/Reading'> {category} diff --git a/src/components/review/ProjectChip/index.tsx b/src/components/review/ProjectChip/index.tsx new file mode 100644 index 0000000..bb3e82c --- /dev/null +++ b/src/components/review/ProjectChip/index.tsx @@ -0,0 +1,21 @@ +import type { PropsWithChildren } from 'react'; +import { memo } from 'react'; + +import Typography from '@/components/common/typography'; + +import * as S from './style'; + +function ProjectChip({ children }: PropsWithChildren) { + return ( + + + {children} + + + ); +} + +export default memo(ProjectChip); diff --git a/src/components/review/ProjectChip/style.ts b/src/components/review/ProjectChip/style.ts new file mode 100644 index 0000000..6c6d77e --- /dev/null +++ b/src/components/review/ProjectChip/style.ts @@ -0,0 +1,8 @@ +import styled from '@emotion/native'; + +export const Container = styled.View` + width: fit-content; + padding: 6px 12px; + background: ${({ theme }) => theme.color.CoolNeutral['98']}; + border-radius: 4px; +`; diff --git a/src/components/review/ReviewCard/index.tsx b/src/components/review/ReviewCard/index.tsx new file mode 100644 index 0000000..e1b6d9f --- /dev/null +++ b/src/components/review/ReviewCard/index.tsx @@ -0,0 +1,42 @@ +import type { PropsWithChildren } from 'react'; + +import Typography from '@/components/common/typography'; +import ProjectChip from '@/components/review/ProjectChip'; + +import * as S from './style'; + +type DateBoxProps = { + startDate: string; + endDate: string; +}; + +function DateBox({ startDate, endDate }: DateBoxProps) { + return ( + + {`${startDate} - ${endDate}`} + + ); +} + +type Props = { + projectName: string; +}; + +function Card({ projectName, children }: PropsWithChildren) { + return ( + + {projectName} + {children} + + ); +} + +const ReviewCard = Object.assign(Card, { + DateBox, +}); + +export default ReviewCard; diff --git a/src/components/review/ReviewCard/style.ts b/src/components/review/ReviewCard/style.ts new file mode 100644 index 0000000..8a034f6 --- /dev/null +++ b/src/components/review/ReviewCard/style.ts @@ -0,0 +1,16 @@ +import styled from '@emotion/native'; + +import { flexDirectionColumn } from '@/styles/common'; + +export const Container = styled.View` + ${flexDirectionColumn}; + gap: 16px; + padding: 12px; + background-color: ${({ theme }) => theme.color.Background.Normal}; + border-radius: 4px; +`; + +export const ContentsBox = styled.View` + ${flexDirectionColumn}; + gap: 8px; +`; diff --git a/src/components/review/ReviewSkeletonCard/ReviewSkeletonCard.stories.tsx b/src/components/review/ReviewSkeletonCard/ReviewSkeletonCard.stories.tsx new file mode 100644 index 0000000..e4acd2a --- /dev/null +++ b/src/components/review/ReviewSkeletonCard/ReviewSkeletonCard.stories.tsx @@ -0,0 +1,60 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { View } from 'react-native'; + +import { SCREEN_SIZE } from '@/constants'; +import { color } from '@/styles/theme'; + +import ReviewSkeletonCard from './'; + +const ReviewSkeletonCardMeta: Meta = { + title: 'review/ReviewSkeletonCard', + component: ReviewSkeletonCard, + argTypes: { + projectName: { + control: { + type: 'text', + }, + description: '프로젝트 이름을 입력합니다.', + }, + startDate: { + control: { + type: 'text', + description: '프로젝트 시작 날짜를 입력합니다.', + }, + }, + endDate: { + control: { + type: 'text', + description: '프로젝트 끝난 날짜를 입력합니다.', + }, + }, + }, +}; + +export default ReviewSkeletonCardMeta; + +export const Primary: StoryObj = { + args: { + projectName: '프로젝트', + startDate: '2024-07', + endDate: '2024-10', + }, + render: (args) => { + return ( + + + + + + ); + }, +}; diff --git a/src/components/review/ReviewSkeletonCard/index.tsx b/src/components/review/ReviewSkeletonCard/index.tsx new file mode 100644 index 0000000..4fc4e61 --- /dev/null +++ b/src/components/review/ReviewSkeletonCard/index.tsx @@ -0,0 +1,32 @@ +import Skeleton from '@/components/common/skeleton'; +import ReviewCard from '@/components/review/ReviewCard'; + +import * as S from './style'; + +type Props = { + projectName: string; + startDate: string; + endDate: string; +}; + +function ReviewSkeletonCard({ projectName, startDate, endDate }: Props) { + return ( + + + + + + + + + + ); +} + +export default ReviewSkeletonCard; diff --git a/src/components/review/ReviewSkeletonCard/style.ts b/src/components/review/ReviewSkeletonCard/style.ts new file mode 100644 index 0000000..90b4c5c --- /dev/null +++ b/src/components/review/ReviewSkeletonCard/style.ts @@ -0,0 +1,12 @@ +import styled from '@emotion/native'; + +import { flexDirectionColumn } from '@/styles/common'; + +export const Container = styled.View` + padding: 14px; +`; + +export const SkeletonBox = styled.View` + ${flexDirectionColumn}; + gap: 8px; +`;