-
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.
전체 모임 필터 작업 및 UI 수정 작업 (필터 모달 삭제) (#997)
* feat: 공지 box 제거 * design: arrow 버튼 모양 변경 * feat: 전체 칩 추가 * feat: useMediaQuery 훅 추가, 카테고리 바깥으로 이동 * feat: 필요없는 ui 제거 * feat: 파트 드롭다운 필터 구현 * chore: 주석 제거 * fix: useMediaQuery 훅 삭제, useDisplay로 변경 * style: CATEGORY_OPTIONS 변경으로 인한 스타일 변경 처리
- Loading branch information
Showing
14 changed files
with
128 additions
and
38 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 |
---|---|---|
|
@@ -93,4 +93,4 @@ | |
"workspaces": [ | ||
"packages/*" | ||
] | ||
} | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,48 @@ | ||
import { ampli } from '@/ampli'; | ||
import { FilterType } from '@constants/option'; | ||
import { useQueryString } from '@hooks/queryString'; | ||
import { SelectV2 } from '@sopt-makers/ui'; | ||
import { useRouter } from 'next/router'; | ||
import React from 'react'; | ||
import { styled } from 'stitches.config'; | ||
|
||
interface DropDownFilterProps { | ||
filter: FilterType; | ||
} | ||
|
||
function DropDownFilter({ filter }: DropDownFilterProps) { | ||
const router = useRouter(); | ||
const selectedPartQuery = router.query.part as string; | ||
const defaultValue = selectedPartQuery ? { label: selectedPartQuery, value: selectedPartQuery } : undefined; | ||
|
||
const { subject, options } = filter; | ||
const { value: selectedValue, setValue, deleteKey } = useQueryString(subject); | ||
|
||
const setPartQuery = (value: string) => { | ||
ampli.clickFilterPart({ group_part: value }); | ||
|
||
if (selectedValue === value) return deleteKey(); | ||
return setValue(value); | ||
}; | ||
|
||
return ( | ||
<SDropDownContainer> | ||
<SelectV2.Root type="text" visibleOptions={6} defaultValue={defaultValue} onChange={setPartQuery}> | ||
<SelectV2.Trigger> | ||
<SelectV2.TriggerContent placeholder={'대상 파트'} /> | ||
</SelectV2.Trigger> | ||
<SelectV2.Menu> | ||
{options.map(option => ( | ||
<SelectV2.MenuItem key={option} option={{ label: option, value: option }} /> | ||
))} | ||
</SelectV2.Menu> | ||
</SelectV2.Root> | ||
</SDropDownContainer> | ||
); | ||
} | ||
|
||
export default DropDownFilter; | ||
|
||
const SDropDownContainer = styled('div', { | ||
ml: '$16', | ||
}); |
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
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
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
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