77 lines
2.1 KiB
TypeScript
77 lines
2.1 KiB
TypeScript
/*
|
|
* File: ProfileScreen.tsx
|
|
* Description: Screen for displaying user profile
|
|
* Design & Developed by Tech4Biz Solutions
|
|
* Copyright (c) Spurrin Innovations. All rights reserved.
|
|
*/
|
|
|
|
import React from 'react';
|
|
import { View, Text, StyleSheet, Image } from 'react-native';
|
|
import { Button } from 'shared/src/components/Button';
|
|
import { Card } from 'shared/src/components/Card';
|
|
import { Colors, Spacing, Typography } from 'shared/src/theme';
|
|
import { useProfile } from '../hooks/useProfile';
|
|
|
|
/**
|
|
* ProfileScreen - shows user info, avatar, and navigation to settings/preferences
|
|
*/
|
|
const ProfileScreen: React.FC<any> = ({ navigation }) => {
|
|
const user = useProfile();
|
|
|
|
if (!user) {
|
|
return <View style={styles.container}><Text>No profile loaded.</Text></View>;
|
|
}
|
|
|
|
return (
|
|
<View style={styles.container}>
|
|
<Card>
|
|
{user.avatar && <Image source={{ uri: user.avatar }} style={styles.avatar} />}
|
|
<Text style={styles.name}>{user.name}</Text>
|
|
<Text style={styles.email}>{user.email}</Text>
|
|
<Button title="Settings" onPress={() => navigation.navigate('Settings')} style={styles.button} />
|
|
<Button title="Preferences" onPress={() => navigation.navigate('Preferences')} style={styles.button} />
|
|
</Card>
|
|
</View>
|
|
);
|
|
};
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
backgroundColor: Colors.background,
|
|
justifyContent: 'center',
|
|
padding: Spacing.lg,
|
|
},
|
|
avatar: {
|
|
width: 80,
|
|
height: 80,
|
|
borderRadius: 40,
|
|
alignSelf: 'center',
|
|
marginBottom: Spacing.md,
|
|
},
|
|
name: {
|
|
fontFamily: Typography.fontFamily.bold,
|
|
fontSize: Typography.fontSize.lg,
|
|
color: Colors.primary,
|
|
textAlign: 'center',
|
|
marginBottom: Spacing.xs,
|
|
},
|
|
email: {
|
|
fontFamily: Typography.fontFamily.regular,
|
|
fontSize: Typography.fontSize.md,
|
|
color: Colors.textSecondary,
|
|
textAlign: 'center',
|
|
marginBottom: Spacing.md,
|
|
},
|
|
button: {
|
|
marginTop: Spacing.sm,
|
|
},
|
|
});
|
|
|
|
export default ProfileScreen;
|
|
|
|
/*
|
|
* End of File: ProfileScreen.tsx
|
|
* Design & Developed by Tech4Biz Solutions
|
|
* Copyright (c) Spurrin Innovations. All rights reserved.
|
|
*/
|