import { Redirect } from 'expo-router'; import React from 'react'; import { ActivityIndicator, KeyboardAvoidingView, Platform, Pressable, SafeAreaView, StyleSheet, Text, TextInput, View, } from 'react-native'; import { useApp } from '@/src/app-context'; export default function AuthScreen() { const { ready, state, actions } = useApp(); if (!ready) { return ( ); } if (state.session?.session) { return ; } return ( SC SecureCam Mobile Sign in to manage visual security. actions.setAuthField('email', value)} /> actions.setAuthField('password', value)} /> {state.isRegistering ? ( actions.setAuthField('name', value)} /> ) : null} void actions.submitAuth()}> {state.isRegistering ? 'Create Account' : 'Sign In'} {state.isRegistering ? 'I already have an account' : 'Create an account'} ); } const styles = StyleSheet.create({ safe: { flex: 1, backgroundColor: '#0a0a0c', }, loading: { flex: 1, backgroundColor: '#0a0a0c', alignItems: 'center', justifyContent: 'center', }, container: { flex: 1, justifyContent: 'center', paddingHorizontal: 22, }, logoWrap: { alignItems: 'center', marginBottom: 30, }, logoBadge: { width: 72, height: 72, borderRadius: 24, backgroundColor: '#1d4ed8', alignItems: 'center', justifyContent: 'center', marginBottom: 14, }, logoIcon: { color: '#f9fafb', fontSize: 22, fontWeight: '700', }, title: { color: '#f9fafb', fontSize: 28, fontWeight: '700', }, subtitle: { marginTop: 8, color: '#9ca3af', fontSize: 13, }, card: { borderRadius: 20, backgroundColor: '#111218', borderWidth: 1, borderColor: 'rgba(255,255,255,0.08)', padding: 18, gap: 12, }, input: { height: 48, borderRadius: 12, borderWidth: 1, borderColor: 'rgba(255,255,255,0.12)', backgroundColor: '#09090d', color: '#f3f4f6', paddingHorizontal: 12, }, primaryButton: { marginTop: 6, height: 48, borderRadius: 12, backgroundColor: '#2563eb', alignItems: 'center', justifyContent: 'center', }, primaryText: { color: '#f9fafb', fontWeight: '600', fontSize: 16, }, secondaryButton: { height: 42, borderRadius: 12, borderWidth: 1, borderColor: 'rgba(255,255,255,0.08)', alignItems: 'center', justifyContent: 'center', }, secondaryText: { color: '#9ca3af', fontSize: 13, fontWeight: '500', }, });