-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
110 lines (101 loc) · 2.54 KB
/
App.js
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
import 'react-native-gesture-handler';
import React from 'react';
import {StatusBar} from 'react-native';
import {DarkTheme, Provider as PaperProvider} from 'react-native-paper';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from 'react-native-screens/native-stack';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import {enableScreens} from 'react-native-screens';
import AnimatedTabBar from '@gorhom/animated-tabbar';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import HeatInputScreen from './screens/HeatInputScreen';
import HistoryScreen from './screens/HistoryScreen';
import WeldabilityScreen from './screens/WeldabilityScreen';
import SettingsScreen from './screens/SettingsScreen';
const theme = {
...DarkTheme,
colors: {
...DarkTheme.colors,
primary: '#ff9800',
accent: '#c66900'
}
};
const tabs = {
HeatInput: {
labelStyle: {
color: '#ff9800'
},
icon: {
component: () => <Icon name="fire" color="#ff9800" size={26}/>
},
background: {
activeColor: '#424242'
}
},
Weldability: {
labelStyle: {
color: '#ff9800'
},
icon: {
component: () => <Icon name="calculator" color="#ff9800" size={26}/>
},
background: {
activeColor: '#424242'
}
},
Settings: {
labelStyle: {
color: '#ff9800'
},
icon: {
component: () => <Icon name="cog-outline" color="#ff9800" size={26}/>
},
background: {
activeColor: '#424242'
}
}
};
enableScreens();
const Stack = createNativeStackNavigator();
const Tab = createBottomTabNavigator();
const HeatInputStack = () => (
<Stack.Navigator screenOptions={{headerShown: false}}>
<Stack.Screen name="Home" component={HeatInputScreen}/>
<Stack.Screen name="History" component={HistoryScreen}/>
</Stack.Navigator>
);
const App = () => (
<NavigationContainer>
<PaperProvider theme={theme}>
<StatusBar
backgroundColor="#212121"
barStyle="light-content"
/>
<Tab.Navigator
tabBarOptions={{
keyboardHidesTabBar: true
}}
tabBar={props => (
<AnimatedTabBar tabBarOptions={{keyboardHidesTabBar: true}} style={{backgroundColor: '#272727'}} tabs={tabs} {...props}/>
)}
>
<Tab.Screen
name="HeatInput"
options={{
tabBarLabel: 'Heat Input'
}}
component={HeatInputStack}
/>
<Tab.Screen
name="Weldability"
component={WeldabilityScreen}
/>
<Tab.Screen
name="Settings"
component={SettingsScreen}
/>
</Tab.Navigator>
</PaperProvider>
</NavigationContainer>
);
export default App;