Skip to content
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

refactor(toks-main): 카테고리 기능 리팩토링 및 Bug Fixed #402

Merged
merged 6 commits into from
Feb 15, 2024

Conversation

minsgy
Copy link
Member

@minsgy minsgy commented Feb 14, 2024

💡 왜 PR을 올렸나요?

  • 카테고리 컴포넌트를 리팩토링합니다.

    • 선택한 카테고리의 개수만큼 보여줍니다.
    • 카테고리 bar 선택 시, 바텀시트가 나타납니다.
    • 카테고리 가나다순 정렬처리했습니다.
      image
  • bug fix

    • 로그인 > 선택 된 카테고리 적용되었지만 버튼이 선택되지 않는 버그 FIX
    • 카테고리 임의 선택(완료를 누르지않음) 후, 바텀시트를 닫아도 선택 된 데이터가 유지되는 버그 FIX
    • 로그인 > 로그아웃 시 카테고리가 초기화 된 것 처럼 보이지만 필터가 적용되는 버그 FIX
    • 바텀시트 껐다켜도 Tab 위치 유지되는 버그 FIX
    • 비로그인 상태에서 퀴즈 풀고 나오면 초기화되는 이슈 FIX
      • template.tsx 단에 RecoilRoot 단이 선언되어 있어서 페이지 렌더링 시, RecoilRoot도 리렌더링되서 초기화됨...

💁 무엇이 어떻게 바뀌나요?

💬 리뷰어분들께

@LineGu LineGu enabled auto-merge (squash) February 14, 2024 13:09
@minsgy minsgy changed the title refactor: 카테고리 기능 리팩토링 및 Bug Fixed refactor(toks-main): 카테고리 기능 리팩토링 및 Bug Fixed Feb 14, 2024
@minsgy minsgy force-pushed the refactor/categories branch from c152c4f to 718dad3 Compare February 14, 2024 13:13
@minsgy minsgy disabled auto-merge February 14, 2024 13:13
@LineGu LineGu enabled auto-merge (squash) February 14, 2024 13:14
@codecov-commenter
Copy link

codecov-commenter commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (dev@6dbc8c8). Click here to learn what that means.

Additional details and impacted files
@@          Coverage Diff          @@
##             dev    #402   +/-   ##
=====================================
  Coverage       ?   0.08%           
=====================================
  Files          ?     176           
  Lines          ?    6178           
  Branches       ?     176           
=====================================
  Hits           ?       5           
  Misses         ?    6173           
  Partials       ?       0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@minsgy minsgy requested review from chaaerim and dengoyoon February 14, 2024 13:29
@minsgy minsgy disabled auto-merge February 14, 2024 13:51
@LineGu LineGu enabled auto-merge (squash) February 14, 2024 14:04
@minsgy minsgy disabled auto-merge February 14, 2024 14:51
Comment on lines +6 to +8
const Provider = ({ children }: StrictPropsWithChildren) => {
return <RecoilRoot>{children}</RecoilRoot>;
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리코일 루트 위치가 에러와 연관이 있었군요..!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 몰랐네요 ㄷㄷ templates 시급하게 때야할듯요

Comment on lines +8 to +14
type CategoriesProps = {
categories: Array<{
categoryName: string;
isSelected: boolean;
}>;
onClick: VoidFunction;
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요건 혹시 interface로 안하고 type으로 하신 이유가 있나요?
아무래도 상관 없긴 하지만 궁금해서 질문드립니다!

Copy link
Member Author

@minsgy minsgy Feb 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type이 변수로도 선언되어서 범용성있고 interface에 비해 희미하지만 약간 성능이 더 좋다고 들었습니다 ㅎㅎ

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호 처음알았어요

Comment on lines +43 to +58
useLayoutEffect(() => {
setSelectedTab(0);
setSelectedLocalCategories([]);
}, [isShow]);

useEffect(() => {
if (isLogin && isShow && selectedLoginCategory.length > 0) {
setSelectedLocalCategories(selectedLoginCategory);
}
}, [isLogin, isShow, selectedLoginCategory]);

useEffect(() => {
if (selectedTemporaryCategory.length > 0 && isShow) {
setSelectedLocalCategories(selectedTemporaryCategory);
}
}, [isShow, selectedTemporaryCategory]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

민석님 혹시 여기 각 useEffect가 어떤 목적으로 작성되었는지 간단한 주석 추가되면 어떨까요?
추후에 알아보기 쉽지 않을까해서 남겨봅니다

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

18411a2 반영했습니다!

@minsgy minsgy requested a review from dengoyoon February 15, 2024 12:30
Copy link
Collaborator

@dengoyoon dengoyoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여러가지 많이 고쳐주셨네요 고생 많으셨습니다!!

@minsgy minsgy merged commit 132cbf1 into dev Feb 15, 2024
2 checks passed
@minsgy minsgy deleted the refactor/categories branch February 15, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants