POWR/app/(tabs)/profile.tsx

79 lines
2.7 KiB
TypeScript
Raw Normal View History

2025-02-09 20:38:38 -05:00
// 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';
2025-02-12 12:55:51 -05:00
import { useSafeAreaInsets } from 'react-native-safe-area-context';
2025-02-15 14:03:42 -05:00
import { TabScreen } from '@/components/layout/TabScreen';
2025-02-09 20:38:38 -05:00
2025-02-12 12:55:51 -05:00
const PLACEHOLDER_IMAGE = 'https://github.com/shadcn.png';
2025-02-09 20:38:38 -05:00
export default function ProfileScreen() {
2025-02-12 12:55:51 -05:00
const insets = useSafeAreaInsets();
2025-02-09 20:38:38 -05:00
return (
2025-02-15 14:03:42 -05:00
<TabScreen>
2025-02-09 20:38:38 -05:00
<Header
title="Profile"
rightElement={
<Button
variant="ghost"
size="icon"
2025-02-15 14:03:42 -05:00
onPress={() => console.log('Open settings')}
2025-02-09 20:38:38 -05:00
>
<Settings className="text-foreground" />
</Button>
}
/>
2025-02-12 12:55:51 -05:00
<ScrollView
className="flex-1"
contentContainerStyle={{
paddingBottom: insets.bottom + 20
}}
>
2025-02-15 14:03:42 -05:00
{/* Profile content remains the same */}
2025-02-09 20:38:38 -05:00
<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">
2025-02-15 14:03:42 -05:00
<Button variant="outline" className="mb-2">
2025-02-09 20:38:38 -05:00
<Text>Edit Profile</Text>
</Button>
2025-02-15 14:03:42 -05:00
<Button variant="outline" className="mb-2">
2025-02-09 20:38:38 -05:00
<Text>Account Settings</Text>
</Button>
2025-02-15 14:03:42 -05:00
<Button variant="outline" className="mb-2">
2025-02-09 20:38:38 -05:00
<Text>Preferences</Text>
</Button>
</View>
</ScrollView>
2025-02-15 14:03:42 -05:00
</TabScreen>
2025-02-09 20:38:38 -05:00
);
}