diff --git a/app/components/common/NavigateHeader.tsx b/app/components/common/NavigateHeader.tsx index 15529bd..68828b8 100644 --- a/app/components/common/NavigateHeader.tsx +++ b/app/components/common/NavigateHeader.tsx @@ -16,9 +16,7 @@ export default function NavigationHeader({ const bg = bgClassName ?? "bg-[#FFFFFF]"; return ( -
+
@@ -82,15 +109,23 @@ function SortOptionButton({ label, active, onClick, + className, }: { label: string; active: boolean; onClick: () => void; + className?: string; }) { return ( diff --git a/app/routes/chat/page.tsx b/app/routes/chat/page.tsx index b3a1949..99e08cf 100644 --- a/app/routes/chat/page.tsx +++ b/app/routes/chat/page.tsx @@ -87,6 +87,9 @@ export default function ChatPage() { onChange={setPendingSort} onClose={() => setIsSortOpen(false)} onApply={applySort} + titleClassName="text-[14px] font-semibold" + optionClassName="text-[12px]" + applyButtonClassName="text-[13px] font-semibold" />
); diff --git a/app/routes/mypage/edit/edit-content.tsx b/app/routes/mypage/edit/edit-content.tsx index 7cb5bad..193ed84 100644 --- a/app/routes/mypage/edit/edit-content.tsx +++ b/app/routes/mypage/edit/edit-content.tsx @@ -341,7 +341,7 @@ export default function MyPageEdit() { setOriginalNickname(nextNickname); setOriginalAddress(nextAddress); setOriginalDetailAddress(nextDetailAddress); - setSuccessMessage("주소 변경 완료"); + setSuccessMessage("회원정보 변경 완료"); } catch (error) { console.error("Failed to update address:", error); toast.error("주소 변경에 실패했습니다."); @@ -477,7 +477,9 @@ export default function MyPageEdit() { ); if (!response.data.isSuccess) { - throw new Error(response.data.message || "회원정보 변경 실패"); + throw new Error( + response.data.message || "회원정보 변경 실패", + ); } setNickname(nextNickname); diff --git a/app/routes/mypage/likes/likes-content.tsx b/app/routes/mypage/likes/likes-content.tsx index c4cbe8f..7583a3e 100644 --- a/app/routes/mypage/likes/likes-content.tsx +++ b/app/routes/mypage/likes/likes-content.tsx @@ -530,6 +530,9 @@ export default function MyPageLikes() { } title="정렬 필터" applyLabel="적용하기" + titleClassName="text-[14px] font-semibold" + optionClassName="text-[12px]" + applyButtonClassName="text-[13px] font-semibold" />
diff --git a/app/routes/mypage/notification/notifications-content.tsx b/app/routes/mypage/notification/notifications-content.tsx index 6c3305e..d59f9b4 100644 --- a/app/routes/mypage/notification/notifications-content.tsx +++ b/app/routes/mypage/notification/notifications-content.tsx @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState } from "react"; +import { useEffect, useState } from "react"; import { useNavigate } from "react-router"; import NavigationHeader from "../../../components/common/NavigateHeader"; import { useHideHeader } from "../../../hooks/useHideHeader"; @@ -31,7 +31,6 @@ export default function MyPageNotifications() { const [appPush, setAppPush] = useState(true); const [emailPush, setEmailPush] = useState(false); const [isSaving, setIsSaving] = useState(false); - const initialSettingsRef = useRef(null); useEffect(() => { const fetchSetting = async () => { @@ -49,11 +48,6 @@ export default function MyPageNotifications() { setBenefitPush(Boolean(data.marketingConsent)); setAppPush(Boolean(data.appPushEnabled)); setEmailPush(Boolean(data.emailEnabled)); - initialSettingsRef.current = { - marketingConsent: Boolean(data.marketingConsent), - appPushEnabled: Boolean(data.appPushEnabled), - emailEnabled: Boolean(data.emailEnabled), - }; } catch (error) { console.error("Failed to load notification setting:", error); } @@ -62,13 +56,7 @@ export default function MyPageNotifications() { fetchSetting(); }, []); - const saveSettings = async () => { - const payload = { - marketingConsent: benefitPush, - appPushEnabled: appPush, - emailEnabled: emailPush, - }; - + const saveSettings = async (payload: NotificationSettingResponse) => { const response = await axiosInstance.put( "/api/v1/users/me/notification-settings", payload, @@ -78,30 +66,24 @@ export default function MyPageNotifications() { throw new Error(response.data.message || "알림 설정 변경 실패"); } - initialSettingsRef.current = payload; }; - const handleBack = async () => { + const updateSettings = async (next: NotificationSettingResponse) => { if (isSaving) return; - - const initial = initialSettingsRef.current; - const hasChanges = initial - ? initial.marketingConsent !== benefitPush || - initial.appPushEnabled !== appPush || - initial.emailEnabled !== emailPush - : false; - - if (!hasChanges) { - navigate(-1); - return; - } + const prev = { + marketingConsent: benefitPush, + appPushEnabled: appPush, + emailEnabled: emailPush, + }; try { setIsSaving(true); - await saveSettings(); - navigate(-1); + await saveSettings(next); } catch (error) { console.error("Failed to update notification setting:", error); + setBenefitPush(prev.marketingConsent); + setAppPush(prev.appPushEnabled); + setEmailPush(prev.emailEnabled); } finally { setIsSaving(false); } @@ -110,11 +92,13 @@ export default function MyPageNotifications() { return (
-
- +
+
+ navigate(-1)} /> +
-
+
{/* 혜택 푸시 */}
@@ -136,7 +120,16 @@ export default function MyPageNotifications() {