Skip to content

Commit 4fff5c0

Browse files
authored
[#206] ✨ 프로젝트 페이지 개발 (#207)
* [#201] ♻️ margin layout to flex flex layout * [#201] ✨ add community page * [#204] 💄 select trigger to flex row * [#204] 💄 add white space in param of join * [#204] ✨ add portfolio page * [#206] 🗑️ remove useless text node * [#206] ✨ add projectlistitem interface * [#206] ✨ add project card + project category label map constant * [#206] ✨ add project page * [#206] 🗑️ remove unused module imports * [#206] 💄 add margin y to login page * [#206] ✨ keep select component dumb * [#206] ♻️ refactor two pages with the altercation of select component * [#206] ✨ add empty search result component * [#207] 🐛 solve conflicts
1 parent 4bd52ac commit 4fff5c0

File tree

12 files changed

+687
-286
lines changed

12 files changed

+687
-286
lines changed

src/app/(pages)/login/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default function Login(): JSX.Element {
6161
}, [setValue])
6262

6363
return (
64-
<div className='m-auto flex h-auto w-420 flex-col pt-238'>
64+
<div className='m-auto my-240 flex h-auto w-420 flex-col'>
6565
<div className='m-auto mb-36'>
6666
<Logo />
6767
</div>

src/app/(pages)/portfolio/page.tsx

Lines changed: 66 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import { PortfolioListItem } from '@/types/api/Portfolio.types'
88
import clsx from 'clsx'
99

1010
import { Button, Link } from '@/components/common/button'
11-
import { Box, Container, Grid } from '@/components/common/containers'
11+
import { DeletableChip } from '@/components/common/chip'
12+
import { Box, Container } from '@/components/common/containers'
1213
import { TextInput } from '@/components/common/input'
1314
import { Text } from '@/components/common/text'
1415
import { PortfolioCard } from '@/components/portfolio/PortfolioCard'
1516
import { Pagination } from '@/components/shared/pagination'
1617
import { Select } from '@/components/shared/select'
1718

1819
import { usePagination } from '@/hooks/usePagination'
19-
import { useToggle } from '@/hooks/useToggle'
2020

2121
const MOCK_DATA: PortfolioListItem[] = [
2222
{
@@ -37,20 +37,14 @@ const MOCK_DATA: PortfolioListItem[] = [
3737
},
3838
]
3939

40-
const stackOptions = [
41-
{ label: '자바스크립트', value: 'Javascript' },
42-
{ label: 'Css', value: 'Css' },
43-
{ label: 'HTML', value: 'HTML' },
44-
{ label: '타입스크립트', value: 'Typescript' },
45-
]
46-
const positionOptions = [
40+
const positionsOptions = [
4741
{ label: '프론트엔드', value: 'frontend' },
4842
{ label: '백엔드', value: 'backend' },
4943
{ label: '풀스택', value: 'fullstack' },
5044
]
5145

5246
export default function PortfolioPage(): JSX.Element {
53-
const [position, setPosition] = useState<string[]>([])
47+
const [positions, setPositions] = useState<string[]>([])
5448
const [order, setOrder] = useState<'recent' | 'like' | 'view'>('recent')
5549
const {
5650
currentPage,
@@ -62,8 +56,8 @@ export default function PortfolioPage(): JSX.Element {
6256
goToPreviousPageGroup,
6357
} = usePagination({ totalItems: 20, itemsPerPage: 10, buttonsPerPage: 10 })
6458

65-
const handlePositionChange = (values: string[]) => {
66-
setPosition(() => values)
59+
const handlepositionsChange = (values: string[]) => {
60+
setPositions(() => values)
6761
}
6862

6963
return (
@@ -127,55 +121,69 @@ export default function PortfolioPage(): JSX.Element {
127121
</Link>
128122
</div>
129123
</div>
130-
<div className='mb-20 flex items-center justify-between'>
131-
<div className='flex gap-12'>
132-
<Select
133-
options={positionOptions}
134-
isMulti={true}
135-
isSearchable={false}
136-
onChange={handlePositionChange}
137-
>
138-
<Select.Trigger placeholder='포지션' />
139-
<Select.Menu className='w-216' />
140-
</Select>
141-
</div>
142-
<div className='flex gap-20'>
143-
<div className='flex gap-40'>
144-
<Button
145-
onClick={() => {
146-
setOrder('recent')
147-
}}
148-
variant='text'
149-
className={clsx('h-auto p-0 text-gray-500', {
150-
'text-gray-800': order === 'recent',
151-
})}
152-
>
153-
최신순
154-
</Button>
155-
<Button
156-
onClick={() => {
157-
setOrder('like')
158-
}}
159-
variant='text'
160-
className={clsx('h-auto p-0 text-gray-500', {
161-
'text-gray-800': order === 'like',
162-
})}
124+
<div className='mb-20 flex flex-col gap-8'>
125+
<div className='flex items-center justify-between'>
126+
<div className='flex gap-12'>
127+
<Select
128+
options={positionsOptions}
129+
selectedValues={positions}
130+
isMulti={true}
131+
isSearchable={false}
132+
onChange={handlepositionsChange}
163133
>
164-
좋아요순
165-
</Button>
166-
<Button
167-
onClick={() => {
168-
setOrder('view')
169-
}}
170-
variant='text'
171-
className={cn('h-auto p-0 text-gray-500', {
172-
'text-gray-800': order === 'view',
173-
})}
174-
>
175-
조회순
176-
</Button>
134+
<Select.Trigger placeholder='포지션' />
135+
<Select.Menu className='w-216' />
136+
</Select>
137+
</div>
138+
<div className='flex gap-20'>
139+
<div className='flex gap-40'>
140+
<Button
141+
onClick={() => {
142+
setOrder('recent')
143+
}}
144+
variant='text'
145+
className={clsx('h-auto p-0 text-gray-500', {
146+
'text-gray-800': order === 'recent',
147+
})}
148+
>
149+
최신순
150+
</Button>
151+
<Button
152+
onClick={() => {
153+
setOrder('like')
154+
}}
155+
variant='text'
156+
className={clsx('h-auto p-0 text-gray-500', {
157+
'text-gray-800': order === 'like',
158+
})}
159+
>
160+
좋아요순
161+
</Button>
162+
<Button
163+
onClick={() => {
164+
setOrder('view')
165+
}}
166+
variant='text'
167+
className={cn('h-auto p-0 text-gray-500', {
168+
'text-gray-800': order === 'view',
169+
})}
170+
>
171+
조회순
172+
</Button>
173+
</div>
177174
</div>
178175
</div>
176+
<div className='flex gap-4'>
177+
{positions.map(position => (
178+
<DeletableChip
179+
key={position}
180+
label={position}
181+
onDelete={() => {
182+
setPositions(prev => prev.filter(v => v !== position))
183+
}}
184+
/>
185+
))}
186+
</div>
179187
</div>
180188
<div className='mb-40 flex h-718 flex-col gap-12 overflow-hidden'>
181189
{MOCK_DATA.map(portfolioItem => (

0 commit comments

Comments
 (0)