-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
전체 모임 필터 작업 및 UI 수정 작업 (필터 모달 삭제) #997
Conversation
|
@@ -18,12 +17,16 @@ import { useRouter } from 'next/router'; | |||
import { useEffect } from 'react'; | |||
import { styled } from 'stitches.config'; | |||
import CrewTab from '@components/CrewTab'; | |||
import Chips from '@components/page/list/Filter/Modal/Chip'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mds chip 이 따로 있는데, mds chip 과 해당 chip 의 디자인이 동일한 게 맞을까요?? 보통의 경우엔 기존의 것이 legacy 이고 mds 컴포넌트로 교체해서요~!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 저 Chips라는 부분이 내부적으로 만든 chip 컴포넌트를 사용하고 있었는데, 해당 chip 컴포넌트를 mds로 변경했어요!
그래서 칩들을 렌더링하는 컴포넌트인 Chips는 거의 그대로 재활용하는 방식으로 구현 진행했습니다 :)
} | ||
|
||
function ChipItem({ label, value, isSelected, addValue, deleteValue }: ChipItemProps) { | ||
function ChipItem({ label, value, isSelected, addValue, deleteValue, resetQuery }: ChipItemProps) { | ||
const isTablet = useMediaQuery('(max-width: 768px)'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
우리 useDisplay 라는 커스텀 훅을 활용하고 있어!! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
알려주셔서 감사합니다 !! 확인하고 반영하겠습니다 ~!
src/hooks/useMediaQuery/index.ts
Outdated
@@ -0,0 +1,19 @@ | |||
import { useEffect, useState } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useDisplay 훅을 활용한다면 useMediaQuery 는 동일한 기능을 하는 훅인 것 같으니 삭제해줘도 괜찮겠다!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다 :) 🚀🚀🚀
flexType: 'verticalCenter', | ||
gap: '$8', | ||
color: '$gray10', | ||
padding: '$18 $20', | ||
border: '1px solid $gray10', | ||
//border: '1px solid $gray10', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
주석 발견! 레거시가 되지 않도록 제거 부탁드립니당
src/constants/option.ts
Outdated
@@ -21,7 +21,7 @@ export const APPROVAL_STATUS_KOREAN_TO_ENGLISH: StringKeyObject = { | |||
거절: 'REJECT', | |||
}; | |||
export const APPLICATION_TYPE = ['신청', '초대']; | |||
export const CATEGORY_OPTIONS = ['번쩍', '스터디', '세미나', '행사']; | |||
export const CATEGORY_OPTIONS = ['전체', '스터디', '세미나', '행사', '번쩍']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CATEGORY_OPTIONS
에 '전체'
를 넣으면 다른 부분과 충돌이 생길 거에요..!
필터에서만 사용하는 부분이 아닌 걸로 기억하는데, 해당 상수를 사용하는 곳 모두 확인 후에 추가된 걸까요 ?
필터에서 '전체'
가 필요하다면 FILTER_OPTIONS = ['전체', ...CATEGORY_OPTIONS];
로 새로 생성하는 것은 어떨까요 ?
번쩍 요소의 순서를 변경한 이유도 궁금합니당
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋은 의견 감사합니다!
확인해보니, 다른 부분들에서는 style 적용하는 용도로만 사용하고 있더라구요 ('스터디'일 경우 빨간 글씨가 나타나도록 함)
그래서 단순하게 CATEGORY_OPTIONS[0] -> CATEGORY_OPTIONS[1] 로 변경하려다가
말씀 주신대로 필터 옵션은 필터 옵션에 맞게 분리하는 게 맞는 것 같아서
CATEGORY_FILTER_OPTIONS 을 새로 만들고 적용시키겠습니다!
번쩍 요소의 순서는 기획 의도 상 번쩍 칩이 가장 오른쪽에 가길 원하셨고, 이미 구현되어 있는 로직에서는 CATEGORY_OPTIONS 을 순서대로 map 돌리면서 렌더링하고 있어서, 기존의 코드를 최대한 활용하기 위해 간단하게 '번쩍' 요소의 순서를 변경하는 방식으로 코드를 구현했습니다!
src/hooks/useMediaQuery/index.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저희가 react-responsive
라이브러리를 사용하고 있는데, 새로 구현해준 이유가 있을까요 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
react-responsive 라이브러리를 사용해서 만든 useDisplay라는 훅이 있는 걸 몰랐어요,,
좋은 지적 감사합니다! 추후 팀원분들이 헷갈리지 않도록 아예 삭제할게요!
const toggle = () => { | ||
if (value === '전체') { | ||
resetQuery(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
전체 클릭시 모든 파라미터를 reset 시키는 방식으로 한다면 다른 필터링 조건들도 함께 날아갈텐데 의도하신 부분이 맞을까요 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네 맞습니다 !
url 쿼리키로 필터링을 하다보니 새로고침을 하더라도 필터링이 유지되던데, 그럼 초기화를 위해 칩을 일일히 다시 선택하며 해제하는게 불편하게 느껴져서 전체 칩 버튼을 클릭하면 전부 리셋되도록 구현했습니다.
@@ -1,5 +1,7 @@ | |||
import { ampli } from '@/ampli'; | |||
import { CATEGORY_FILTER, PART_FILTER, STATUS_FILTER } from '@constants/option'; | |||
import { useMediaQuery } from '@hooks/useMediaQuery'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
라이브러리 사용하고 있으니 직접 구현한 것을 사용할 필요가 없을 것 같다는 생각이 드는데 ..! 다른 의도가 있으신지 궁금합니다 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위에서 이유는 설명드렸으니 여기선 생략하겠습니당
useDisplay로 변경하겠습니다..!!
코리 전부 반영했습니다! dev 머지하겠습니다 |
🚩 관련 이슈
📋 작업 내용
📌 PR Point
📸 스크린샷
2025-01-30.11.57.42.mov