-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* refactor: color 값들을 변경합니다. * refactor: 변경된 projectList를 적용합니다. * fix: 가운데 정렬을 통해 글자를 가운데로 맞춥니다. * refactor: web 환경에서는 프로젝트를 등록할 수 없게 합니다.
- Loading branch information
Showing
12 changed files
with
227 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import type { ProjectItemType } from '@/components/project/ProjectList'; | ||
|
||
export const MOCK_PROJECT_ITEM: ProjectItemType = { | ||
id: 1, | ||
name: '위프로', | ||
profile: 'https://picsum.photos/200', | ||
review_count: 3, | ||
member_num: 6, | ||
}; | ||
|
||
export const MOCK_PROJECT_LIST: ProjectItemType[] = [ | ||
{ | ||
id: 1, | ||
name: '위프로', | ||
profile: 'https://picsum.photos/200', | ||
review_count: 3, | ||
member_num: 6, | ||
}, | ||
{ | ||
id: 2, | ||
name: '후피', | ||
profile: 'https://picsum.photos/200', | ||
review_count: 1, | ||
member_num: 3, | ||
}, | ||
{ | ||
id: 3, | ||
name: 'Code Red', | ||
profile: 'https://picsum.photos/200', | ||
review_count: 2, | ||
member_num: 3, | ||
}, | ||
{ | ||
id: 4, | ||
name: 'Veco', | ||
profile: 'https://picsum.photos/200', | ||
review_count: 3, | ||
member_num: 3, | ||
}, | ||
{ | ||
id: 5, | ||
name: 'Zero Waste', | ||
profile: 'https://picsum.photos/200', | ||
review_count: 0, | ||
member_num: 3, | ||
}, | ||
] as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/components/project/ProjectItem/ProjectItem.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { View } from 'react-native'; | ||
|
||
import { MOCK_PROJECT_ITEM } from '@/__mock__/project'; | ||
import { color } from '@/styles/theme'; | ||
|
||
import ProjectItem from './'; | ||
|
||
const ProjectItemMeta: Meta<typeof ProjectItem> = { | ||
title: 'project/ProjectItem', | ||
component: ProjectItem, | ||
argTypes: { | ||
member_num: { | ||
control: { | ||
type: 'number', | ||
}, | ||
description: '프로젝트의 총 인원 수를 지정합니다.', | ||
}, | ||
name: { | ||
control: { | ||
type: 'text', | ||
}, | ||
description: '프로젝트의 이름을 지정합니다.', | ||
}, | ||
profile: { | ||
control: { | ||
type: 'text', | ||
}, | ||
description: '프로젝트의 이미지를 지정합니다.', | ||
}, | ||
review_count: { | ||
control: { | ||
type: 'number', | ||
}, | ||
description: '프로젝트의 리뷰 수를 지정합니다.', | ||
}, | ||
id: { | ||
control: { | ||
type: 'number', | ||
}, | ||
description: '프로젝트의 id를 지정합니다.', | ||
}, | ||
}, | ||
}; | ||
|
||
export default ProjectItemMeta; | ||
|
||
export const Primary: StoryObj<typeof ProjectItem> = { | ||
render: () => { | ||
return ( | ||
<View style={{ flex: 1, backgroundColor: color.Background.Alternative, padding: 10 }}> | ||
<ProjectItem {...MOCK_PROJECT_ITEM} /> | ||
</View> | ||
); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import SlideBar from '@/components/common/slide-bar'; | ||
import Typography from '@/components/common/typography'; | ||
import ProjectImage from '@/components/project/ProjectImage'; | ||
import type { ProjectItemType } from '@/components/project/ProjectList'; | ||
import { color } from '@/styles/theme'; | ||
|
||
import * as S from './style'; | ||
|
||
function ProjectItem({ name, member_num, profile, review_count }: ProjectItemType) { | ||
return ( | ||
<S.Container> | ||
<ProjectImage uri={profile} /> | ||
<S.ProjectStatusBox> | ||
<Typography | ||
variant='Caption1' | ||
color={color.Label.Alternative}> | ||
프로젝트 | ||
</Typography> | ||
<S.ProgressBox> | ||
<S.ProgressInfo> | ||
<Typography | ||
variant='Body1/Normal' | ||
fontWeight='semiBold' | ||
color={color.Label.Normal}> | ||
{name} | ||
</Typography> | ||
<Typography | ||
variant='Caption1' | ||
color={color.Label.Assistive}> | ||
{review_count} / {member_num} | ||
</Typography> | ||
</S.ProgressInfo> | ||
<SlideBar | ||
max_value={member_num} | ||
current_value={review_count} | ||
/> | ||
</S.ProgressBox> | ||
</S.ProjectStatusBox> | ||
</S.Container> | ||
); | ||
} | ||
|
||
export default ProjectItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import styled from '@emotion/native'; | ||
|
||
import { flexDirectionColumn, flexDirectionRowItemsCenter } from '@/styles/common'; | ||
|
||
export const Container = styled.View` | ||
${flexDirectionRowItemsCenter}; | ||
gap: 10px; | ||
padding: 16px; | ||
background-color: ${({ theme }) => theme.color.Background.Normal}; | ||
border-radius: 8px; | ||
`; | ||
|
||
export const ProjectStatusBox = styled.View` | ||
${flexDirectionColumn}; | ||
flex-grow: 1; | ||
`; | ||
|
||
export const ProgressBox = styled.View` | ||
${flexDirectionColumn}; | ||
gap: 6px; | ||
`; | ||
|
||
export const ProgressInfo = styled.View` | ||
${flexDirectionRowItemsCenter}; | ||
justify-content: space-between; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.