mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-25 03:31:12 -05:00
Refactor: Simplify auth and profile handling
This commit is contained in:
@@ -3,6 +3,7 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Settings, User, Shield, Eye, Bell, MapPin, Download, MonitorSmartphone } from 'lucide-react';
|
||||
import { useAuth } from '@/hooks/useAuth';
|
||||
import { useProfile } from '@/hooks/useProfile';
|
||||
import { Navigate } from 'react-router-dom';
|
||||
import { Header } from '@/components/layout/Header';
|
||||
import { AccountProfileTab } from '@/components/settings/AccountProfileTab';
|
||||
@@ -14,8 +15,11 @@ import { LocationTab } from '@/components/settings/LocationTab';
|
||||
import { DataExportTab } from '@/components/settings/DataExportTab';
|
||||
|
||||
export default function UserSettings() {
|
||||
const { user, loading } = useAuth();
|
||||
const { user, loading: authLoading } = useAuth();
|
||||
const { data: profile, isLoading: profileLoading } = useProfile(user?.id);
|
||||
const [activeTab, setActiveTab] = useState('profile');
|
||||
|
||||
const loading = authLoading || profileLoading;
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user