-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
106 lines (100 loc) · 3.27 KB
/
App.js
File metadata and controls
106 lines (100 loc) · 3.27 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
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { StatusBar } from 'expo-status-bar';
import { Text, View } from 'react-native';
import ConvertScreen from './src/screens/ConvertScreen';
import ARScreen from './src/screens/ARScreen';
import MapScreen from './src/screens/MapScreen';
import HomeScreen from './src/screens/HomeScreen';
import P2PScreen from './src/screens/P2PScreen';
import SettingsScreen from './src/screens/SettingsScreen';
import { colors } from './src/utils/theme';
import { SettingsProvider } from './src/utils/SettingsContext';
const Tab = createBottomTabNavigator();
const Stack = createNativeStackNavigator();
const TAB_ICONS = {
'LOCATE': '⊛',
'FIND': '⊕',
'P2P': '⇌',
'AR': '◎',
'MAP': '▦',
'CONFIG': '≡',
};
function TabIcon({ label, focused }) {
return (
<View style={{ alignItems: 'center', gap: 2 }}>
<Text style={{ fontSize: 16, color: focused ? colors.accent : colors.textDim }}>
{TAB_ICONS[label]}
</Text>
<Text style={{
fontSize: 8,
fontFamily: 'Courier',
letterSpacing: 1.5,
color: focused ? colors.accent : colors.textDim,
}}>
{label}
</Text>
</View>
);
}
function ConvertStack() {
return (
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name="ConvertMain" component={ConvertScreen} />
<Stack.Screen
name="AR"
component={ARScreen}
options={{ animation: 'slide_from_bottom' }}
/>
</Stack.Navigator>
);
}
export default function App() {
return (
<SafeAreaProvider>
<SettingsProvider>
<StatusBar style="light" backgroundColor={colors.bg} />
<NavigationContainer
theme={{
dark: true,
colors: {
primary: colors.accent,
background: colors.bg,
card: colors.bgCard,
text: colors.text,
border: colors.border,
notification: colors.accent,
},
}}
>
<Tab.Navigator
screenOptions={({ route }) => ({
headerShown: false,
tabBarShowLabel: false,
tabBarStyle: {
backgroundColor: colors.bgCard,
borderTopColor: colors.border,
borderTopWidth: 1,
height: 60,
paddingBottom: 4,
},
tabBarIcon: ({ focused }) => (
<TabIcon label={route.name} focused={focused} />
),
})}
>
<Tab.Screen name="LOCATE" component={HomeScreen} />
<Tab.Screen name="FIND" component={ConvertStack} />
<Tab.Screen name="P2P" component={P2PScreen} />
<Tab.Screen name="AR" component={ARScreen} />
<Tab.Screen name="MAP" component={MapScreen} />
<Tab.Screen name="CONFIG" component={SettingsScreen} />
</Tab.Navigator>
</NavigationContainer>
</SettingsProvider>
</SafeAreaProvider>
);
}