diff --git a/src/app/mypage/layout.tsx b/src/app/mypage/layout.tsx index 83919c83..28166691 100644 --- a/src/app/mypage/layout.tsx +++ b/src/app/mypage/layout.tsx @@ -11,7 +11,7 @@ interface LayoutProps { export default function Layout({ children }: LayoutProps) { const router = useRouter(); - const handleClickSettingButton = () => router.push('/setting'); + const handleClickSettingButton = () => router.push('/settings'); return (
diff --git a/src/app/mypage/page.tsx b/src/app/mypage/page.tsx index 6b6c56e3..37ba5f29 100644 --- a/src/app/mypage/page.tsx +++ b/src/app/mypage/page.tsx @@ -13,7 +13,6 @@ import { useGetUserProfile } from '@hooks/api/useGetUserProfile'; import { usePutUserName } from '@hooks/api/usePutUserName'; import MyLogContent from '@components/mypage/MyLogContent'; import BookMarkContent from '@components/mypage/BookMarkContent'; -import useInput from '@hooks/useInput'; export default function Page() { const [isInputActive, setIsInputActive] = useState(false); @@ -31,7 +30,11 @@ export default function Page() { const userLevel = userProfile?.level || DEFAULT_DDOBAP_LEVEL; const StatusImage = DDOBAP_LEVEL_IMAGE[userLevel]; - const [nickName, , setNickName] = useInput(userProfile?.nickname ?? ''); + const [nickName, setNickName] = useState(userProfile?.nickname); + + useEffect(() => { + setNickName(userProfile?.nickname); + }, [userProfile?.nickname]); useEffect(() => { let timer: NodeJS.Timeout; @@ -57,7 +60,7 @@ export default function Page() { const handleInputBlur = () => { setIsInputActive(false); - if (!nickName.trim().length) setNickName(userProfile?.nickname || ''); + if (!nickName?.trim().length) setNickName(userProfile?.nickname || ''); else putUserName(nickName || ''); }; @@ -78,7 +81,7 @@ export default function Page() { 또잇또잇 리포트 -
+