Skip to content

Commit

Permalink
Fix: page 이동 시 undefined 수정, 초대 네비바 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
goeun208 committed Mar 18, 2024
1 parent 0de60cc commit 946e6d7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 33 deletions.
4 changes: 0 additions & 4 deletions src/components/common/navbar/NavInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,4 @@ export const NAV_INFO = {
label: '투표',
url: NAV_URL_LIST.VOTE,
},
[NAV_LIST.INVITE]: {
label: '초대',
url: NAV_URL_LIST.INVITE,
},
} as const satisfies Record<(typeof NAV_LIST)[keyof typeof NAV_LIST], NavItemType>;
2 changes: 0 additions & 2 deletions src/components/common/navbar/Navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ export const NAV_LIST = {
MAIN: 'MAIN',
PARTICIPANT: 'PARTICIPANT',
VOTE: 'VOTE',
INVITE: 'INVITE',
} as const;
export const NAV_URL_LIST = {
[NAV_LIST.MAIN]: '/main',
[NAV_LIST.PARTICIPANT]: '/participant',
[NAV_LIST.VOTE]: '/vote',
[NAV_LIST.INVITE]: '/invite',
} as const;
24 changes: 0 additions & 24 deletions src/components/common/navbar/inviteIndex.tsx

This file was deleted.

8 changes: 5 additions & 3 deletions src/components/invite/InviteSpaceInvite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { useSetRecoilState } from 'recoil';
import { groupNameAtom } from '@/states/groupNameAtom';
import api from '@/services/TokenService';
import { useGetGroup } from '@/hooks/useGetGroup';
import InviteNavbar from '../common/navbar/inviteIndex';
import { groupIdAtom } from '@/states/groupIdAtom';
import Navbar from '../common/navbar';
// import { useRouter } from 'next/router';

const InviteSpaceInvite = ({ id }: any) => {
Expand All @@ -29,7 +29,9 @@ const InviteSpaceInvite = ({ id }: any) => {
useEffect(() => {
if (response?.data?.message === '성공') setPartData(response.data?.data);
sessionStorage.setItem('groupId', id);
id !== null && setGroupId(id);
setGroupId({
groupId: parseInt(id),
});
console.log('id입니다: ', id);
}, [id, response, setGroupId]);

Expand Down Expand Up @@ -61,7 +63,7 @@ const InviteSpaceInvite = ({ id }: any) => {
return (
<section>
<Header />
<InviteNavbar focusType={NAV_LIST.INVITE} />
<Navbar focusType={NAV_LIST.PARTICIPANT} />
<div className="max-w-[1200px] mx-auto font-Pretendard">
{partData && <ParticipationList data={partData} mode={false} setMode={undefined} />}
</div>
Expand Down

0 comments on commit 946e6d7

Please sign in to comment.