Skip to content

Commit

Permalink
feat: 내비게이션 연결
Browse files Browse the repository at this point in the history
  • Loading branch information
jhsung23 committed Sep 21, 2024
1 parent 6a9f421 commit a1101ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/pages/Meeting.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useSuspenseQuery } from '@tanstack/react-query';
import { useNavigate } from 'react-router-dom';

import { queries } from '@/apis';
import { FixedBottomButton } from '@/components/common/FixedBottomButton';
Expand All @@ -8,6 +9,7 @@ import { Icon } from '@/components/common/Icon';
import { MeetingList } from '@/components/features/MeetingList';

export const Meeting = () => {
const navigate = useNavigate();
const { data } = useSuspenseQuery(queries.member.meetings); // TODO 에러처리
const isDataEmpty = data.length === 0;

Expand All @@ -16,9 +18,11 @@ export const Meeting = () => {
<Header left={<Icon name="jjakkakText" size={{ width: 115, height: 13 }} color="BK" />} />
<MeetingList title="나의 모임" data={data} />
{isDataEmpty ? (
<FixedBottomButton>모임 일정 생성하기</FixedBottomButton>
<FixedBottomButton onClick={() => navigate('/meeting/new')}>
모임 일정 생성하기
</FixedBottomButton>
) : (
<FloatingActionButton />
<FloatingActionButton onClick={() => navigate('/meeting/new')} />
)}
</>
);
Expand Down
4 changes: 1 addition & 3 deletions src/pages/NewMeeting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ export const NewMeeting = () => {
dispatch({ type: 'categoryIds', payload: { ...formData, categoryIds } });
},
}}
onPrev={() => {
/* TODO navigate */
}}
onPrev={() => navigate(-1)}
onNext={() => setStep('모임이름')}
/>
</Funnel.Step>
Expand Down

0 comments on commit a1101ce

Please sign in to comment.