import React from 'react'; import { KeyboardAvoidingView, Platform, Pressable, ScrollView, StyleSheet, Text, View, } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { Ionicons } from '@expo/vector-icons'; import { useRouter } from 'expo-router'; import { colors, fontSize, radii, spacing } from '@/theme'; /** Shared frame for the signed-out screens: brand, title, scrollable body. */ export function AuthShell({ title, subtitle, back, error, children, }: { title: string; subtitle?: string; back?: boolean; error?: string | null; children: React.ReactNode; }) { const insets = useSafeAreaInsets(); const router = useRouter(); return ( {back ? ( router.back()} hitSlop={12} style={styles.back}> ) : null} {title} {subtitle ? {subtitle} : null} {error ? ( {error} ) : null} {children} ); } const styles = StyleSheet.create({ container: { paddingHorizontal: spacing[5], flexGrow: 1 }, back: { alignSelf: 'flex-start', marginLeft: -6, marginBottom: spacing[2] }, head: { alignItems: 'center', marginBottom: spacing[7] }, mark: { width: 54, height: 54, borderRadius: 16, backgroundColor: colors.ink900, alignItems: 'center', justifyContent: 'center', }, title: { fontSize: fontSize['2xl'], fontWeight: '700', color: colors.ink, marginTop: spacing[4], textAlign: 'center', }, subtitle: { fontSize: fontSize.sm, color: colors.textMuted, textAlign: 'center', marginTop: 8, maxWidth: 300, lineHeight: 20, }, errorBox: { flexDirection: 'row', alignItems: 'center', gap: 8, backgroundColor: colors.dangerBg, borderRadius: radii.md, padding: spacing[3], marginBottom: spacing[4], }, errorText: { color: colors.dangerText, fontSize: fontSize.sm, flex: 1 }, });