account.tsx 721 B

123456789101112131415161718192021222324
  1. import { Button } from 'react-native';
  2. import { View, Text } from 'react-native';
  3. import { useAuth } from '../../../context/AuthProvider';
  4. export default function AccountScreen() {
  5. const { user, logout } = useAuth();
  6. if (!user) return <Text>Loading...</Text>;
  7. return (
  8. <View
  9. style={{
  10. flex: 1,
  11. flexDirection: 'column',
  12. justifyContent: 'center',
  13. alignItems: 'center',
  14. paddingHorizontal: 4
  15. }}
  16. >
  17. <Text className="mb-8">Account PAGE</Text>
  18. <Text>{user?.username || 'No username'}</Text>
  19. <Button title="Log out" onPress={logout} />
  20. </View>
  21. );
  22. }