-
Notifications
You must be signed in to change notification settings - Fork 4
Feat/Fix: 예약 현황 달력 WIP, 내 체험 관리 이미지 Fix #39
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
Feat/Fix: 예약 현황 달력 WIP, 내 체험 관리 이미지 Fix #39
Conversation
|
@Squarecat-meow is attempting to deploy a commit to the Hong's projects Team on Vercel. A member of the Team first needs to authorize it. |
LeeTaegyung
left a comment
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.
고생하셨습니다! 코멘트 드렸는데, 코드 취향에 관련된 내용도 있어서 ㅎㅎ 보시구 합당하다 싶으면 적용해주시면 될거 같습니다!
| queryFn: getMyExperiences, | ||
| }); | ||
| const { setIsTabOpen } = useContext(TabContext); | ||
| const { accessToken } = useTokenStore(); |
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.
const accessToken = useTokenStore(state => state.accessToken) 으로 수정해주셔야 할거 같아요!
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.
아 그러네요!
| <section className='flex flex-col items-center gap-8'> | ||
| <div className='w-full flex flex-col gap-2 md:justify-between'> | ||
| <div className='flex gap-4'> | ||
| <BackBtn /> |
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.
백버튼 위치를 다 합치고 나서 한번에 좀 정리를 해야할거 같네요 😅
| const fn = async () => { | ||
| const activitiesList = await getMyExperiences(); | ||
| if (!activitiesList || activitiesList.totalCount === 0) | ||
| setActivities(null); | ||
| setActivities(activitiesList); | ||
| }; | ||
| fn(); |
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.
네 그러네요ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ이것도 팩토리에 넣어두겠습니다!
| ) : ( | ||
| <LoadingSpinner /> | ||
| )} |
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.
분기처리가 너무 세세해서 한눈에 안들어오는거 같아요.
jsx 문법이 시작하기 전에 if(activities === undefined) return <LoadingSpinner /> 해주는게 좀 더 깔끔할거 같아요.
| Promise.all( | ||
| data.map((el) => { | ||
| return getMyReservationStatus( | ||
| el.id, | ||
| format(calendarDisplayDate, 'yyyy'), | ||
| format(calendarDisplayDate, 'MM') | ||
| ); | ||
| }) | ||
| ).then((res) => setReservedSchedule(res)); |
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.
api 요청을 하나만 하는데, Promise.all이 필요할까 싶습니다.
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.
data로 받아온 모든 체험 일정들을 map으로 순회하면서 API 요청을 동기로 받아오는 부분이에요!
src/services/primitives/queries.ts
Outdated
| queryOptions({ | ||
| queryKey: [...queries.myExperiences()], | ||
| queryFn: () => getMyExperiences(), | ||
| enabled: !!accessToken, |
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.
AuthProvider에서 유저가 로그인되지 않은 상황이라면, 리다이렉트로 마이페이지에 접속하지 못하도록 처리가 되어 있어서, accessToken으로 enabled 처리를 해줄 필요가 있나 싶네요.
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.
오... 아예 접근 자체가 안되면 accessToken은 빼도 될 것 같습니다!
무엇을 했나요?
subImages[0]에서bannerImage로 변경했습니다.스크린샷