diff --git a/src/components/settings/AccountProfileTab.tsx b/src/components/settings/AccountProfileTab.tsx index 2f7881fe..71945475 100644 --- a/src/components/settings/AccountProfileTab.tsx +++ b/src/components/settings/AccountProfileTab.tsx @@ -5,15 +5,13 @@ import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Textarea } from '@/components/ui/textarea'; import { Label } from '@/components/ui/label'; -import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { Separator } from '@/components/ui/separator'; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from '@/components/ui/alert-dialog'; import { useAuth } from '@/hooks/useAuth'; import { useProfile } from '@/hooks/useProfile'; import { supabase } from '@/integrations/supabase/client'; -import { User, Upload, Trash2, Mail, AlertCircle, X, Check, Loader2 } from 'lucide-react'; +import { Trash2, Mail, AlertCircle, X, Check, Loader2 } from 'lucide-react'; import { PhotoUpload } from '@/components/upload/PhotoUpload'; import { notificationService } from '@/lib/notificationService'; import { EmailChangeDialog } from './EmailChangeDialog'; @@ -22,7 +20,7 @@ import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'; import { AccountDeletionDialog } from './AccountDeletionDialog'; import { DeletionStatusBanner } from './DeletionStatusBanner'; import { EmailChangeStatus } from './EmailChangeStatus'; -import { usernameSchema, displayNameSchema, bioSchema, personalLocationSchema, preferredPronounsSchema } from '@/lib/validation'; +import { usernameSchema, displayNameSchema, bioSchema } from '@/lib/validation'; import { z } from 'zod'; import { AccountDeletionRequest } from '@/types/database'; import { handleError, handleSuccess, AppError } from '@/lib/errorHandler'; @@ -35,11 +33,7 @@ import { cn } from '@/lib/utils'; const profileSchema = z.object({ username: usernameSchema, display_name: displayNameSchema, - bio: bioSchema, - preferred_pronouns: preferredPronounsSchema, - show_pronouns: z.boolean(), - preferred_language: z.string(), - personal_location: personalLocationSchema + bio: bioSchema }); type ProfileFormData = z.infer; @@ -67,11 +61,7 @@ export function AccountProfileTab() { defaultValues: { username: profile?.username || '', display_name: profile?.display_name || '', - bio: profile?.bio || '', - preferred_pronouns: profile?.preferred_pronouns || '', - show_pronouns: profile?.show_pronouns || false, - preferred_language: profile?.preferred_language || 'en', - personal_location: profile?.personal_location || '' + bio: profile?.bio || '' } }); @@ -122,9 +112,7 @@ export function AccountProfileTab() { const { data: result, error } = await supabase.rpc('update_profile', { p_username: data.username, p_display_name: data.display_name || null, - p_bio: data.bio || null, - p_preferred_pronouns: data.preferred_pronouns || null, - p_personal_location: data.personal_location || null + p_bio: data.bio || null }); if (error) { @@ -340,125 +328,74 @@ export function AccountProfileTab() {
-

Profile Information

- -
-
-