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

공통 컴포넌트 구현 (버튼, 진행 중인 미션 배너) (issue #94) #104

Merged
merged 9 commits into from
Jul 24, 2024

Conversation

chosim-dvlpr
Copy link
Contributor

구현 요약

  1. 진행 중인 미션 배너 api 연결
  2. InProgress 컴포넌트에서 타이틀과 배너 분리
  3. Completed 컴포넌트에서 타이틀과 card list 분리
  4. 미션 현황 페이지 디자인 수정

연관 이슈

close #94

참고

코드 리뷰에 RCA 룰을 적용할 시 참고해주세요.

헤더 설명
R (Request Changes) 적극적으로 반영을 고려해주세요
C (Comment) 웬만하면 반영해주세요
A (Approve) 반영해도 좋고, 넘어가도 좋습니다. 사소한 의견입니다.

@chosim-dvlpr chosim-dvlpr added 🎨 프론트엔드 프론트엔드 관련 이슈 ⚒️ 기능 작업해야하는 기능 labels Jul 23, 2024
@chosim-dvlpr chosim-dvlpr self-assigned this Jul 23, 2024
Copy link
Contributor

@brgndyy brgndyy left a comment

Choose a reason for hiding this comment

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

프룬 고생 많으셨어요~!

useSuspenseQuery 관련해서 코멘트 하나 남겨보았는데 확인해주시면 감사하겠습니다!

import { useSuspenseQuery } from '@tanstack/react-query';

const useMissionInProgress = () => {
const { data, isLoading, isError, isSuccess } = useSuspenseQuery<MissionInProgress>({
Copy link
Contributor

Choose a reason for hiding this comment

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

이 useSuspenseQuery 자체를 리턴해주면 사용하는 컴포넌트 단에서 선택적으로 필요한 부분을 골라서 사용할수 있을거 같은데요!?

useSuspenseQuery를 사용하면 자동으로 상위에서 감싸준 Suspense를 감지해서 isLoading 상태값 없이 선언적으로 표현해볼수 있을거 같아요 👍

const useMissionInProgress = () => {
  return useSuspenseQuery< MissionInProgress >({
    queryKey: ['inProgress'],
    queryFn: getMissionInProgress,
  });
};

- Component.tsx

export default function MyMissionInProgressBanner() {
  const { data: missionInProgress, isSuccess } = useMissionInProgress();

위처럼 isSuccess나 isError 등등 필요한 값들만 꺼내와서 사용할수 있어서 조금 더 확장성이 있지 않을까 하는데 어떻게 생각하세요 !?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

오 이렇게 바로 작성하는 방법도 있군요! 감사합니다 버건디👍

@chosim-dvlpr chosim-dvlpr requested review from Parkhanyoung and removed request for Parkhanyoung July 23, 2024 08:20
@brgndyy brgndyy merged commit c56a1f3 into main Jul 24, 2024
4 checks passed
@Minjoo522 Minjoo522 deleted the feat/#94 branch July 25, 2024 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚒️ 기능 작업해야하는 기능 🎨 프론트엔드 프론트엔드 관련 이슈
Projects
Status: 😎 DONE
Development

Successfully merging this pull request may close these issues.

공통 컴포넌트 구현 (버튼, 진행 중 미션 배너)
2 participants