-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
138 lines (130 loc) · 3.66 KB
/
App.js
File metadata and controls
138 lines (130 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import React from 'react';
import { StatusBar } from 'expo-status-bar';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { Text, View, Button, StyleSheet } from 'react-native';
import { Feather } from '@expo/vector-icons';
// Import navigators and providers
import MainNavigator from './src/navigation/MainNavigator';
import { EmergencyProvider } from './src/context/EmergencyContext';
import { AuthProvider } from './src/context/AuthContext';
// Mock Auth Screen with login button
const AuthScreen = ({ navigation }) => (
<View style={styles.authContainer}>
<View style={styles.logoContainer}>
<Text style={styles.logoTextPrimary}>Pashu</Text>
<Text style={styles.logoTextSecondary}>AI</Text>
</View>
<Text style={styles.subtitle}>Help street animals with confidence</Text>
<View style={styles.buttonContainer}>
<Button
title="Mock Login (Skip Authentication)"
onPress={() => navigation.navigate('MainApp')}
/>
</View>
<Text style={styles.devNote}>
Development Note: This button bypasses authentication for testing
</Text>
</View>
);
// Mock Emergency Screen
const EmergencyScreen = ({ navigation }) => (
<View style={styles.screenContainer}>
<View style={styles.header}>
<Button title="Back" onPress={() => navigation.goBack()} />
<Text style={styles.headerTitle}>Help an Animal</Text>
<View style={{width: 50}}></View>
</View>
<Text style={styles.screenContent}>Emergency Screen Content</Text>
</View>
);
// Create stack navigator
const Stack = createStackNavigator();
// Root App component
export default function App() {
return (
<SafeAreaProvider>
<NavigationContainer>
<AuthProvider>
<EmergencyProvider>
<Stack.Navigator initialRouteName="Auth">
<Stack.Screen
name="Auth"
component={AuthScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="MainApp"
component={MainNavigator}
options={{ headerShown: false }}
/>
</Stack.Navigator>
</EmergencyProvider>
</AuthProvider>
<StatusBar style="auto" />
</NavigationContainer>
</SafeAreaProvider>
);
}
// Styles
const styles = StyleSheet.create({
authContainer: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
padding: 20,
backgroundColor: 'white',
},
logoContainer: {
flexDirection: 'row',
marginBottom: 10,
},
logoTextPrimary: {
fontSize: 32,
fontWeight: 'bold',
color: '#5B61F4',
},
logoTextSecondary: {
fontSize: 32,
fontWeight: 'bold',
color: '#36B37E',
},
subtitle: {
fontSize: 16,
color: '#666666',
marginBottom: 40,
},
buttonContainer: {
width: '100%',
marginBottom: 20,
},
devNote: {
fontSize: 12,
color: 'gray',
marginTop: 20,
textAlign: 'center',
},
screenContainer: {
flex: 1,
backgroundColor: '#F5F5F5',
},
header: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
padding: 15,
backgroundColor: 'white',
borderBottomWidth: 1,
borderBottomColor: '#EEEEEE',
},
headerTitle: {
fontSize: 18,
fontWeight: '600',
},
screenContent: {
fontSize: 16,
textAlign: 'center',
marginTop: 20,
},
});