POWR/app/(tabs)/profile.tsx
2025-02-15 14:03:42 -05:00

79 lines
2.7 KiB
TypeScript

// app/(tabs)/profile.tsx
import { View, ScrollView } from 'react-native';
import { Settings } from 'lucide-react-native';
import { H1 } from '@/components/ui/typography';
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
import { Button } from '@/components/ui/button';
import { Text } from '@/components/ui/text';
import Header from '@/components/Header';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { TabScreen } from '@/components/layout/TabScreen';
const PLACEHOLDER_IMAGE = 'https://github.com/shadcn.png';
export default function ProfileScreen() {
const insets = useSafeAreaInsets();
return (
<TabScreen>
<Header
title="Profile"
rightElement={
<Button
variant="ghost"
size="icon"
onPress={() => console.log('Open settings')}
>
<Settings className="text-foreground" />
</Button>
}
/>
<ScrollView
className="flex-1"
contentContainerStyle={{
paddingBottom: insets.bottom + 20
}}
>
{/* Profile content remains the same */}
<View className="items-center pt-6 pb-8">
<Avatar className="w-24 h-24 mb-4" alt="Profile picture">
<AvatarImage source={{ uri: PLACEHOLDER_IMAGE }} />
<AvatarFallback>
<Text className="text-2xl">JD</Text>
</AvatarFallback>
</Avatar>
<H1 className="text-xl font-semibold mb-1">John Doe</H1>
<Text className="text-muted-foreground">@johndoe</Text>
</View>
<View className="flex-row justify-around px-4 py-6 bg-card">
<View className="items-center">
<Text className="text-2xl font-bold">24</Text>
<Text className="text-muted-foreground">Workouts</Text>
</View>
<View className="items-center">
<Text className="text-2xl font-bold">12</Text>
<Text className="text-muted-foreground">Templates</Text>
</View>
<View className="items-center">
<Text className="text-2xl font-bold">3</Text>
<Text className="text-muted-foreground">Programs</Text>
</View>
</View>
<View className="p-4 gap-2">
<Button variant="outline" className="mb-2">
<Text>Edit Profile</Text>
</Button>
<Button variant="outline" className="mb-2">
<Text>Account Settings</Text>
</Button>
<Button variant="outline" className="mb-2">
<Text>Preferences</Text>
</Button>
</View>
</ScrollView>
</TabScreen>
);
}