@@ -8,15 +8,15 @@ import { PortfolioListItem } from '@/types/api/Portfolio.types'
88import clsx from 'clsx'
99
1010import { 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'
1213import { TextInput } from '@/components/common/input'
1314import { Text } from '@/components/common/text'
1415import { PortfolioCard } from '@/components/portfolio/PortfolioCard'
1516import { Pagination } from '@/components/shared/pagination'
1617import { Select } from '@/components/shared/select'
1718
1819import { usePagination } from '@/hooks/usePagination'
19- import { useToggle } from '@/hooks/useToggle'
2020
2121const 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
5246export 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