-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): 프로젝트 둘러보기 페이지 퍼블리싱 (#28)
* feat(client): projectSelectBox 컴포넌트 추가 * feat(client): 프로젝트 둘러보기 페이지 추가
- Loading branch information
Showing
13 changed files
with
199 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Container, Wrapper } from '@/components/layouts'; | ||
import { ProjectSelectBox } from '@/components/projects'; | ||
import { ProjectOptions, ProjectsMeta, ProjectStatus } from '@/constants'; | ||
import { ProjectCard } from '@jjoing/ui'; | ||
import { FaPlus } from 'react-icons/fa6'; | ||
|
||
const ProjectsPage = () => { | ||
return ( | ||
<Container className="py-10 min-h-[100vh] bg-gray-10"> | ||
<Wrapper> | ||
<div className="h-[40px] mb-5 flex items-center gap-[10px]"> | ||
<ProjectSelectBox options={ProjectStatus} /> | ||
<ProjectSelectBox options={ProjectOptions} /> | ||
</div> | ||
<div className="flex items-end justify-between"> | ||
<span className="text-xl font-medium">프로젝트 목록 📋</span> | ||
<div className="flex items-center justify-center rounded-md bg-primary size-[35px] cursor-p hover:bg-primaryHover transition duration-15"> | ||
<FaPlus className="size-[18px] text-white" /> | ||
</div> | ||
</div> | ||
<div className="my-5 grid grid-cols-3 gap-[25px]"> | ||
{ProjectsMeta.map((project) => ( | ||
<ProjectCard key={project.id} {...project} /> | ||
))} | ||
</div> | ||
</Wrapper> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default ProjectsPage; |
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 @@ | ||
export { default as ProjectSelectBox } from './projectSelectBox'; |
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,51 @@ | ||
'use client'; | ||
|
||
import { ProjectSortOption } from '@/types'; | ||
import { Text } from '@jjoing/ui'; | ||
import { memo, useState } from 'react'; | ||
import { IoIosArrowDown, IoIosArrowUp } from 'react-icons/io'; | ||
|
||
type ProjectSelectBoxProps = { | ||
options: ProjectSortOption[]; | ||
}; | ||
|
||
const ProjectSelectBox = memo(({ options }: ProjectSelectBoxProps) => { | ||
const [isClickButton, setIsClickButton] = useState(false); | ||
const [clickButtonOption, setClickButtonOption] = useState(options[0]); // 백엔드로 요청할때는 id를 넘겨야 하므로 객체를 기본값으로 가짐 | ||
|
||
const handleOpenAndCloseOptions = () => { | ||
setIsClickButton(!isClickButton); | ||
}; | ||
|
||
const handleOptionClick = (option: ProjectSortOption) => { | ||
setClickButtonOption(option); | ||
setIsClickButton(false); | ||
}; | ||
|
||
return ( | ||
<div className="flex flex-col gap-5 relative"> | ||
<button | ||
className="w-[150px] h-[40px] px-3 border border-gray-300 focus:border-gray-400 rounded-md bg-white flex items-center justify-between transition duration-30" | ||
onClick={handleOpenAndCloseOptions} | ||
> | ||
<Text type="body3">{clickButtonOption?.content}</Text> | ||
{isClickButton ? <IoIosArrowUp /> : <IoIosArrowDown />} | ||
</button> | ||
{isClickButton && ( | ||
<div className="absolute top-[45px] w-full border rounded-md border-gray-300 bg-white z-10"> | ||
{options.map((option) => ( | ||
<div | ||
className="w-full h-[40px] px-3 flex items-center cursor-p rounded-md hover:bg-gray-100 transition duration-30" | ||
onClick={() => handleOptionClick(option)} | ||
key={option.id} | ||
> | ||
<Text type="body3">{option.content}</Text> | ||
</div> | ||
))} | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}); | ||
|
||
export default ProjectSelectBox; |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
export * from './interviewMetadata'; | ||
export * from './projectOptions'; | ||
export * from './projectsMetadata'; | ||
export * from './projectStatus'; | ||
export * from './promotionMetadata'; |
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,14 @@ | ||
export const ProjectOptions = [ | ||
{ | ||
id: 0, | ||
content: '최신순', | ||
}, | ||
{ | ||
id: 1, | ||
content: '조회수 많은 순', | ||
}, | ||
{ | ||
id: 2, | ||
content: '좋아요 많은 순', | ||
}, | ||
]; |
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,14 @@ | ||
export const ProjectStatus = [ | ||
{ | ||
id: 0, | ||
content: '전체 프로젝트', | ||
}, | ||
{ | ||
id: 1, | ||
content: '진행중인 프로젝트', | ||
}, | ||
{ | ||
id: 2, | ||
content: '끝난 프로젝트', | ||
}, | ||
]; |
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,63 @@ | ||
export const ProjectsMeta = [ | ||
{ | ||
id: 0, | ||
title: 'radiohead', | ||
subTitle: 'paranoid android', | ||
projectDeadline: '2024-10-21', | ||
maxProjectMembers: 5, | ||
currentProjectMembers: 1, | ||
viewCount: 100, | ||
heartCount: 10, | ||
}, | ||
{ | ||
id: 1, | ||
title: 'radiohead', | ||
subTitle: 'paranoid android', | ||
projectDeadline: '2024-10-21', | ||
maxProjectMembers: 5, | ||
currentProjectMembers: 1, | ||
viewCount: 100, | ||
heartCount: 10, | ||
}, | ||
{ | ||
id: 2, | ||
title: 'radiohead', | ||
subTitle: | ||
'paranoid android paranoid android paranoid android paranoid android paranoid android paranoid android', | ||
projectDeadline: '2024-10-21', | ||
maxProjectMembers: 5, | ||
currentProjectMembers: 1, | ||
viewCount: 100, | ||
heartCount: 10, | ||
}, | ||
{ | ||
id: 3, | ||
title: 'radiohead', | ||
subTitle: 'paranoid android', | ||
projectDeadline: '2024-10-21', | ||
maxProjectMembers: 5, | ||
currentProjectMembers: 1, | ||
viewCount: 100, | ||
heartCount: 10, | ||
}, | ||
{ | ||
id: 4, | ||
title: 'radiohead', | ||
subTitle: 'paranoid android', | ||
projectDeadline: '2024-10-21', | ||
maxProjectMembers: 5, | ||
currentProjectMembers: 1, | ||
viewCount: 100, | ||
heartCount: 10, | ||
}, | ||
{ | ||
id: 5, | ||
title: 'radiohead', | ||
subTitle: 'paranoid android', | ||
projectDeadline: '2024-10-21', | ||
maxProjectMembers: 5, | ||
currentProjectMembers: 1, | ||
viewCount: 100, | ||
heartCount: 10, | ||
}, | ||
]; |
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 @@ | ||
export * from './projectSortOption'; |
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,4 @@ | ||
export type ProjectSortOption = { | ||
id: number; | ||
content: string; | ||
}; |
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 |
---|---|---|
|
@@ -5,4 +5,8 @@ export const colors = { | |
|
||
secondary: '#264466', | ||
secondaryHover: '#182A3E', | ||
|
||
gray: { | ||
10: '#F8F9FA', | ||
}, | ||
}; |
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