diff --git a/src/components/mypage/UserProfileLayout.tsx b/src/components/mypage/UserProfileLayout.tsx index 631e377..df24a76 100644 --- a/src/components/mypage/UserProfileLayout.tsx +++ b/src/components/mypage/UserProfileLayout.tsx @@ -28,7 +28,13 @@ export default function UserProfileLayout() { return (
- +

{user.nickname}

diff --git a/src/context/MypageProvider.tsx b/src/context/MypageProvider.tsx index 7978422..47adc59 100644 --- a/src/context/MypageProvider.tsx +++ b/src/context/MypageProvider.tsx @@ -4,18 +4,20 @@ import { useGetUser } from '@/apis/user/queries'; import dayjs, { Dayjs } from 'dayjs'; import { useGetMonthlyEmotionLogs } from '@/apis/emotion-log/queries'; +const defaultUser = { + image: process.env.NEXT_PUBLIC_DEFAULT_IMAGE_URL ?? '', + createdAt: '', + updatedAt: '', + teamId: '', + nickname: '사용자', + id: 0, +}; + export const MypageContext = createContext({ currentDate: dayjs(), setCurrentDate: () => {}, userEmotion: [], - user: { - image: '', - createdAt: '', - updatedAt: '', - teamId: '', - nickname: '', - id: 0, - }, + user: defaultUser, }); export default function MypageProvider({ children }: PropsWithChildren) { @@ -32,7 +34,16 @@ export default function MypageProvider({ children }: PropsWithChildren) { enabled: !!user && !!currentDate, }); - if (!user || !userEmotion) return
로딩 중...
; - - return {children}; + return ( + + {children} + + ); }