From e0b60155016fe53d15470cafbbac1f6a6c0d927c Mon Sep 17 00:00:00 2001 From: yujin Jeon <101913688+yuj2n@users.noreply.github.com> Date: Sun, 22 Jun 2025 07:32:50 +0900 Subject: [PATCH 1/8] =?UTF-8?q?=F0=9F=90=9Bfix:=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=ED=95=84=20=EC=88=98=EC=A0=95=20=ED=9B=84=20=EC=A0=80=EC=9E=A5?= =?UTF-8?q?=20=EC=8B=9C=20=ED=97=A4=EB=8D=94=20=EC=82=AC=EC=9A=A9=EC=9E=90?= =?UTF-8?q?=20=EC=A0=95=EB=B3=B4=20=EB=AF=B8=EA=B0=B1=EC=8B=A0=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/features/auth/hooks/useAuth.ts | 1 + .../mypage/components/ProfileEditForm.tsx | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/app/features/auth/hooks/useAuth.ts b/src/app/features/auth/hooks/useAuth.ts index 18a0140..6432b31 100644 --- a/src/app/features/auth/hooks/useAuth.ts +++ b/src/app/features/auth/hooks/useAuth.ts @@ -24,5 +24,6 @@ export function useAuth() { return { updateAuthState, logout, + setUser, } } diff --git a/src/app/features/mypage/components/ProfileEditForm.tsx b/src/app/features/mypage/components/ProfileEditForm.tsx index 5cab41e..a6d2eaa 100644 --- a/src/app/features/mypage/components/ProfileEditForm.tsx +++ b/src/app/features/mypage/components/ProfileEditForm.tsx @@ -7,6 +7,8 @@ import { useRouter } from 'next/navigation' import { useEffect, useState } from 'react' import { Controller, useForm } from 'react-hook-form' +import { useAuthStore } from '@/app/features/auth/store/useAuthStore' + import { useUpdateMyProfileMutation } from '../hook/useUpdateMyProfileMutation' import { useUploadProfileImageMutation } from '../hook/useUploadProfileImageMutation' import { useUserQuery } from '../hook/useUserQurey' @@ -41,6 +43,9 @@ export default function ProfileEditForm() { const { mutateAsync: uploadImage } = useUploadProfileImageMutation() const { mutateAsync: updateProfile } = useUpdateMyProfileMutation() + // Zustand 상태 갱신 함수 가져오기 + const setUser = useAuthStore((state) => state.setUser) + // 유저 정보가 비동기적으로 넘어오기 때문에 유저가 로딩된 시점에서 RHF을 초기화 하기 위함 (SSR 도입 시 변경 예정) useEffect(() => { if (user) { @@ -69,8 +74,18 @@ export default function ProfileEditForm() { profileImageUrl: imageUrl, } - // 서버에 프로필 정보 수정 요청 (PUT) - await updateProfile(submitData) + // 서버에 프로필 수정 요청 + const updatedUser = await updateProfile(submitData) + + if (!user) return // user가 없으면 갱신하지 않음 + + // zustand 상태 갱신 (전역 사용자 정보 업데이트) + setUser({ + ...user, + nickname: updatedUser.nickname ?? data.nickname, + profileImageUrl: updatedUser.profileImageUrl ?? imageUrl, + // 필요 시 추가 필드도 넣기 + }) // 사용자에게 성공 알림 + 컴포넌트 최신화 showSuccess('프로필 변경이 완료되었습니다.') From 9e9a39b50b784703f9486d8852032d5029fa04ab Mon Sep 17 00:00:00 2001 From: yujin Jeon <101913688+yuj2n@users.noreply.github.com> Date: Sun, 22 Jun 2025 07:59:21 +0900 Subject: [PATCH 2/8] =?UTF-8?q?=F0=9F=8E=A8style:=20=ED=97=A4=EB=8D=94=20?= =?UTF-8?q?=EB=B0=98=EC=9D=91=ED=98=95=20=ED=8B=80=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/shared/components/common/header/Header.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/shared/components/common/header/Header.tsx b/src/app/shared/components/common/header/Header.tsx index 01b4b76..8720485 100644 --- a/src/app/shared/components/common/header/Header.tsx +++ b/src/app/shared/components/common/header/Header.tsx @@ -9,13 +9,15 @@ import UserDropdown from './UserDropdown' export default function Header() { return ( -
+
{/* 좌측 대시보드명 */} - +
+ +
{/* 우측 사용자 정보/다크모드 */} -
+
{/* 협업자 목록 */} From 036fcc1f2c828d8077d20ee94689d97544641898 Mon Sep 17 00:00:00 2001 From: yujin Jeon <101913688+yuj2n@users.noreply.github.com> Date: Sun, 22 Jun 2025 08:00:30 +0900 Subject: [PATCH 3/8] =?UTF-8?q?=F0=9F=8E=A8style:=20=EB=8C=80=EC=8B=9C?= =?UTF-8?q?=EB=B3=B4=EB=93=9C=20=EC=88=98=EC=A0=95=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EB=B0=98=EC=9D=91=ED=98=95=20=ED=8B=80=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/dashboard/[id]/edit/page.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/dashboard/[id]/edit/page.tsx b/src/app/dashboard/[id]/edit/page.tsx index 0f1b81d..8d1cd97 100644 --- a/src/app/dashboard/[id]/edit/page.tsx +++ b/src/app/dashboard/[id]/edit/page.tsx @@ -23,14 +23,16 @@ export default function DashBoardEditPage() { 돌아가기

돌아가기

-
+ + {/* 컨텐츠 박스: 기본 너비 500px, 화면 작으면 100% 최대 500px */} +
- {/* 삭제 버튼 영역 */} -
+ {/* 삭제 버튼 영역: 기본 너비 292px, 화면 작으면 100% 최대 292px, 좌측 margin 제거 */} +
From 90cbbd69aed88d24e52db63720dfccda09b4ae60 Mon Sep 17 00:00:00 2001 From: yujin Jeon <101913688+yuj2n@users.noreply.github.com> Date: Sun, 22 Jun 2025 08:02:05 +0900 Subject: [PATCH 4/8] =?UTF-8?q?=F0=9F=8E=A8style:=20=EB=B0=98=EC=9D=91?= =?UTF-8?q?=ED=98=95=20=EC=B5=9C=EB=8C=80=20=EB=84=88=EB=B9=84=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9=20=EB=B0=8F=20=EA=B8=80=EC=9E=90=20=EA=B9=A8=EC=A7=90?= =?UTF-8?q?=20=EB=B0=A9=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/edit/DeleteDashboardButton.tsx | 2 +- .../dashboard/components/edit/EditInfo.tsx | 2 +- .../components/edit/EditInvitation.tsx | 142 +++++++++--------- .../dashboard/components/edit/EditMember.tsx | 2 +- .../components/edit/PaginationHeader.tsx | 6 +- 5 files changed, 73 insertions(+), 81 deletions(-) diff --git a/src/app/features/dashboard/components/edit/DeleteDashboardButton.tsx b/src/app/features/dashboard/components/edit/DeleteDashboardButton.tsx index f0b5764..29d4460 100644 --- a/src/app/features/dashboard/components/edit/DeleteDashboardButton.tsx +++ b/src/app/features/dashboard/components/edit/DeleteDashboardButton.tsx @@ -58,7 +58,7 @@ export default function DeleteDashboardButton({ onClick={handleDelete} // isLoading -> isPending으로 수정됨 disabled={mutation.isPending} - className={`Text-black my-8 rounded-8 font-semibold transition-opacity ${ + className={`Text-black my-8 whitespace-nowrap rounded-8 font-semibold transition-opacity ${ mutation.isPending ? 'cursor-not-allowed opacity-50' : 'hover:opacity-90' diff --git a/src/app/features/dashboard/components/edit/EditInfo.tsx b/src/app/features/dashboard/components/edit/EditInfo.tsx index 2c0534f..2fe513c 100644 --- a/src/app/features/dashboard/components/edit/EditInfo.tsx +++ b/src/app/features/dashboard/components/edit/EditInfo.tsx @@ -16,7 +16,7 @@ export default function EditInfo() { return (
-
+

{selectedDashboard?.title || '대시보드 편집'}

diff --git a/src/app/features/dashboard/components/edit/EditInvitation.tsx b/src/app/features/dashboard/components/edit/EditInvitation.tsx index 3f732e1..a7fa396 100644 --- a/src/app/features/dashboard/components/edit/EditInvitation.tsx +++ b/src/app/features/dashboard/components/edit/EditInvitation.tsx @@ -97,85 +97,77 @@ export default function EditInvitation() { : null return ( -
-
- + + - - -
- -
- {isLoading && ( -

로딩 중...

- )} - - {errorMessage && ( -

{errorMessage}

- )} - - {!isLoading && !errorMessage && currentItems.length === 0 && ( -

- 초대된 사용자가 없습니다. -

- )} - - {!isLoading && - !errorMessage && - currentItems.map((member, index) => { - const isLast = index === currentItems.length - 1 - return ( -
+ 초대 버튼 +
+

초대하기

+ + + + + +
+ {isLoading && ( +

로딩 중...

+ )} + + {errorMessage && ( +

{errorMessage}

+ )} + + {!isLoading && + !errorMessage && + currentItems.map((member, index) => { + const isLast = index === currentItems.length - 1 + return ( +
+
+
+ +

+ {member.invitee.email} +

+
+
+
+ + -
- ) - })} -
- -
+ {cancelMutation.isPending ? '취소 중...' : '취소'} + +
+ ) + })} +
+
) } diff --git a/src/app/features/dashboard/components/edit/EditMember.tsx b/src/app/features/dashboard/components/edit/EditMember.tsx index ba12246..bf43e2e 100644 --- a/src/app/features/dashboard/components/edit/EditMember.tsx +++ b/src/app/features/dashboard/components/edit/EditMember.tsx @@ -64,7 +64,7 @@ export default function EditMember() { return (
-
+
+

{title}

-
-

+

+

{totalPages} 페이지 중 {currentPage}