-
404
-
Oops! Page not found
-
- Return to Home
-
+
+
+
+
+
+
+
+
페이지를 찾을 수 없습니다
+
+ 요청하신 페이지가 존재하지 않거나 접근 권한이 없습니다.
+ 이동하려는 주소가 올바른지 확인해주세요.
+
+
+
+
+
+
+
+
);
diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx
index adf438f..2da0be5 100644
--- a/src/pages/Settings.tsx
+++ b/src/pages/Settings.tsx
@@ -1,3 +1,4 @@
+
import React from 'react';
import { useNavigate } from 'react-router-dom';
import NavBar from '@/components/NavBar';
@@ -5,21 +6,30 @@ import SyncSettings from '@/components/SyncSettings';
import { User, CreditCard, Bell, Lock, HelpCircle, LogOut, ChevronRight } from 'lucide-react';
import { cn } from '@/lib/utils';
import { useAuth } from '@/contexts/auth';
+import { useToast } from '@/hooks/use-toast';
const SettingsOption = ({
icon: Icon,
label,
description,
onClick,
- color = "text-neuro-income"
+ color = "text-neuro-income",
+ disabled = false
}: {
icon: React.ElementType;
label: string;
description?: string;
onClick?: () => void;
color?: string;
+ disabled?: boolean;
}) => {
- return
+ return
@@ -36,12 +46,26 @@ const SettingsOption = ({
const Settings = () => {
const navigate = useNavigate();
const { user, signOut } = useAuth();
+ const { toast } = useToast();
const handleLogout = async () => {
await signOut();
navigate('/login');
};
+ const handleProtectedRouteClick = (path: string, label: string) => {
+ if (!user) {
+ toast({
+ title: "로그인 필요",
+ description: `${label}에 접근하려면 로그인이 필요합니다.`,
+ variant: "destructive",
+ });
+ navigate('/login');
+ } else {
+ navigate(path);
+ }
+ };
+
return
{/* Header */}
@@ -73,15 +97,40 @@ const Settings = () => {
{/* Settings Options */}
계정
- navigate('/profile-management')} />
- navigate('/payment-methods')} />
- navigate('/notification-settings')} />
+ handleProtectedRouteClick('/profile', '프로필 관리')}
+ />
+ handleProtectedRouteClick('/payment-methods', '결제 방법')}
+ />
+ handleProtectedRouteClick('/notifications', '알림 설정')}
+ />
앱 설정
- navigate('/security-privacy-settings')} />
- navigate('/help-support')} />
+ handleProtectedRouteClick('/security-privacy', '보안 및 개인정보')}
+ />
+ navigate('/help-support')}
+ />