import { Redirect } from 'expo-router';
import { ScrollView, StyleSheet, Text, View } from 'react-native';
import { Avatar } from '@/components/common/Avatar';
import { Catamaran, FunnelSans } from '@/constants/fonts';
import { Palette } from '@/constants/palette';
import { Radius, Spacing } from '@/constants/styles';
import { useAuth } from '@/providers/AuthProvider';
function formatDate(value?: Date | null) {
if (!value) {
return '-';
}
return value.toLocaleDateString('fr-FR', {
day: '2-digit',
month: 'long',
year: 'numeric',
});
}
function InfoRow({ label, value }: { label: string; value: string }) {
return (
{label}
{value}
);
}
export default function ProfileScreen() {
const { initializing, user } = useAuth();
if (initializing) {
return ;
}
if (!user) {
return ;
}
return (
{user.username || 'Profil'}
{user.email}
);
}
const styles = StyleSheet.create({
screen: {
flex: 1,
backgroundColor: Palette.cream,
},
content: {
paddingHorizontal: Spacing.lg,
paddingTop: Spacing.xl,
paddingBottom: Spacing.xxl,
gap: Spacing.lg,
},
header: {
alignItems: 'center',
gap: Spacing.md,
},
headerContent: {
alignItems: 'center',
gap: Spacing.xs,
},
title: {
...Catamaran.extraBold34,
color: Palette.black,
},
subtitle: {
...FunnelSans.regular16,
color: Palette.gray,
},
card: {
gap: Spacing.md,
padding: Spacing.md,
borderWidth: 1,
borderColor: Palette.cream,
borderRadius: Radius.xl,
backgroundColor: Palette.white,
},
infoRow: {
gap: Spacing.xs,
paddingBottom: Spacing.sm,
borderBottomWidth: 1,
borderBottomColor: Palette.cream,
},
infoLabel: {
...FunnelSans.medium12,
color: Palette.gray,
textTransform: 'uppercase',
},
infoValue: {
...FunnelSans.regular16,
color: Palette.black,
},
});