/** * TabataFit Profile Screen * React Native + SwiftUI Islands — wired to shared data */ import { View, StyleSheet, ScrollView, Text as RNText } from 'react-native' import { useSafeAreaInsets } from 'react-native-safe-area-context' import { LinearGradient } from 'expo-linear-gradient' import { BlurView } from 'expo-blur' import Ionicons from '@expo/vector-icons/Ionicons' import { Host, List, Section, Switch, Text, LabeledContent, } from '@expo/ui/swift-ui' import { useUserStore } from '@/src/shared/stores' import { StyledText } from '@/src/shared/components/StyledText' import { BRAND, DARK, TEXT, GLASS, SHADOW, GRADIENTS, } from '@/src/shared/constants/colors' import { SPACING, LAYOUT } from '@/src/shared/constants/spacing' import { RADIUS } from '@/src/shared/constants/borderRadius' const FONTS = { LARGE_TITLE: 34, TITLE_2: 22, HEADLINE: 17, SUBHEADLINE: 15, CAPTION_1: 12, } // ═══════════════════════════════════════════════════════════════════════════ // MAIN SCREEN // ═══════════════════════════════════════════════════════════════════════════ export default function ProfileScreen() { const insets = useSafeAreaInsets() const profile = useUserStore((s) => s.profile) const settings = useUserStore((s) => s.settings) const updateSettings = useUserStore((s) => s.updateSettings) const isPremium = profile.subscription !== 'free' const planLabel = isPremium ? 'TabataFit+' : 'Free' return ( {/* Header */} Profile {/* Profile Card */} {profile.name[0]} {profile.name} {profile.email} {isPremium && ( {planLabel} )} {/* Subscription */} {isPremium && ( {planLabel} {'Member since ' + profile.joinDate} )} {/* SwiftUI Island: Settings */}
updateSettings({ haptics: v })} color={BRAND.PRIMARY} /> updateSettings({ soundEffects: v })} color={BRAND.PRIMARY} /> updateSettings({ voiceCoaching: v })} color={BRAND.PRIMARY} />
updateSettings({ reminders: v })} color={BRAND.PRIMARY} /> {settings.reminderTime.replace(':00', ':00 AM')}
{/* Version */} TabataFit v1.0.0
) } // ═══════════════════════════════════════════════════════════════════════════ // STYLES // ═══════════════════════════════════════════════════════════════════════════ const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: DARK.BASE, }, scrollView: { flex: 1, }, scrollContent: { paddingHorizontal: LAYOUT.SCREEN_PADDING, }, // Profile Card profileCard: { borderRadius: RADIUS.GLASS_CARD, overflow: 'hidden', marginBottom: SPACING[6], marginTop: SPACING[4], alignItems: 'center', paddingVertical: SPACING[6], borderWidth: 1, borderColor: 'rgba(255, 255, 255, 0.1)', ...SHADOW.md, }, avatarContainer: { width: 80, height: 80, borderRadius: 40, alignItems: 'center', justifyContent: 'center', marginBottom: SPACING[3], overflow: 'hidden', }, premiumBadge: { flexDirection: 'row', alignItems: 'center', backgroundColor: 'rgba(255, 107, 53, 0.15)', paddingHorizontal: SPACING[3], paddingVertical: SPACING[1], borderRadius: RADIUS.FULL, marginTop: SPACING[3], gap: SPACING[1], }, // Subscription Card subscriptionCard: { height: 80, borderRadius: RADIUS.LG, overflow: 'hidden', marginBottom: SPACING[6], ...SHADOW.BRAND_GLOW, }, subscriptionContent: { flex: 1, flexDirection: 'row', alignItems: 'center', paddingHorizontal: SPACING[4], gap: SPACING[3], }, subscriptionInfo: { flex: 1, }, // Version Text versionText: { textAlign: 'center', marginTop: SPACING[6], }, })