From 507aae51aa8308db47cb201cfa59407aedb27ec2 Mon Sep 17 00:00:00 2001 From: y00eunji Date: Sun, 28 Jan 2024 23:05:36 +0900 Subject: [PATCH 1/2] =?UTF-8?q?#138=20feat:=20=EB=A7=88=EC=9D=B4=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=9D=B4=EB=A6=84=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=EA=B0=92=20=EA=B8=80=EC=9E=90=20=EC=88=98=20=EC=A0=9C?= =?UTF-8?q?=ED=95=9C=20=EB=B0=8F=20settings=20=EC=9D=B4=EB=A6=84=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/mypage/layout.tsx | 2 +- src/app/mypage/page.tsx | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) 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() { Date: Sun, 28 Jan 2024 23:14:35 +0900 Subject: [PATCH 2/2] =?UTF-8?q?#138=20style:=20=EB=A6=AC=ED=8F=AC=ED=8A=B8?= =?UTF-8?q?=20=EC=8A=A4=ED=83=80=EC=9D=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/main/StoreDetailSection/Report/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/main/StoreDetailSection/Report/index.tsx b/src/components/main/StoreDetailSection/Report/index.tsx index f8af1860..e1a2424b 100644 --- a/src/components/main/StoreDetailSection/Report/index.tsx +++ b/src/components/main/StoreDetailSection/Report/index.tsx @@ -6,7 +6,7 @@ export default function Report() { return (
또잇또잇 리포트 -
+