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 OnboardingScreen() {
const { ready, state, actions } = useApp();
if (!ready) {
return (
);
}
if (!state.session?.session) {
return ;
}
if (state.deviceToken) {
return ;
}
return (
Configure Device
Set up this mobile dashboard role.
Device Name
actions.setOnboardingField('name', value)}
/>
Role
actions.selectRole('camera')}>
Camera
actions.selectRole('client')}>
Client
Push Token (Optional)
actions.setOnboardingField('pushToken', value)}
/>
void actions.registerDevice()}>
Complete Setup
void actions.loadSavedDevice()}>
Load previously saved device
);
}
const styles = StyleSheet.create({
safe: {
flex: 1,
backgroundColor: '#0a0a0c',
},
loading: {
flex: 1,
backgroundColor: '#0a0a0c',
alignItems: 'center',
justifyContent: 'center',
},
container: {
flex: 1,
justifyContent: 'center',
paddingHorizontal: 20,
},
heading: {
marginBottom: 20,
},
title: {
color: '#f9fafb',
fontSize: 28,
fontWeight: '700',
},
subtitle: {
color: '#9ca3af',
fontSize: 13,
marginTop: 6,
},
card: {
borderRadius: 20,
backgroundColor: '#111218',
borderWidth: 1,
borderColor: 'rgba(255,255,255,0.08)',
padding: 18,
gap: 12,
},
label: {
fontSize: 11,
letterSpacing: 0.6,
textTransform: 'uppercase',
color: '#9ca3af',
fontWeight: '600',
},
input: {
height: 48,
borderRadius: 12,
borderWidth: 1,
borderColor: 'rgba(255,255,255,0.12)',
backgroundColor: '#09090d',
color: '#f3f4f6',
paddingHorizontal: 12,
},
roleRow: {
flexDirection: 'row',
gap: 10,
},
roleButton: {
flex: 1,
height: 42,
borderRadius: 10,
backgroundColor: '#1f2230',
borderWidth: 1,
borderColor: 'rgba(255,255,255,0.08)',
alignItems: 'center',
justifyContent: 'center',
},
roleButtonActive: {
backgroundColor: '#1d4ed8',
borderColor: '#2563eb',
},
roleText: {
color: '#9ca3af',
fontWeight: '600',
},
roleTextActive: {
color: '#f9fafb',
},
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',
},
});