-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
123 lines (108 loc) · 3.3 KB
/
App.tsx
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
// import React from 'react';
// import { Box, NativeBaseProvider } from 'native-base';
// import {
// SafeAreaView,
// ScrollView,
// StatusBar,
// useColorScheme,
// View,
// } from 'react-native';
// import {
// Colors,
// } from 'react-native/Libraries/NewAppScreen';
// import Home from './src/screens/Home';
// import { NavigationContainer } from '@react-navigation/native';
// function App(): React.JSX.Element {
// const isDarkMode = useColorScheme() === 'dark';
// const backgroundStyle = {
// backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
// };
// return (
// <NavigationContainer>
// <NativeBaseProvider>
// <SafeAreaView style={backgroundStyle}>
// <StatusBar
// barStyle={isDarkMode ? 'light-content' : 'dark-content'}
// backgroundColor={backgroundStyle.backgroundColor}
// />
// <ScrollView
// contentInsetAdjustmentBehavior="automatic"
// style={backgroundStyle}>
// <Box
// background={isDarkMode ? Colors.dark : Colors.light}
// >
// <Home />
// </Box>
// </ScrollView>
// </SafeAreaView>
// </NativeBaseProvider>
// </NavigationContainer>
// );
// }
// export default App;
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { Box, Image, NativeBaseProvider, StatusBar, Text } from 'native-base';
import About from './src/screens/About';
import Home from './src/screens/Home';
import Icon from 'react-native-vector-icons/MaterialIcons'
import { useColorScheme } from 'react-native';
function App() {
const Tab = createBottomTabNavigator();
const isDarkMode = useColorScheme() === 'dark';
return (
<NavigationContainer>
<StatusBar backgroundColor="#F89F1B" />
<NativeBaseProvider>
<Box
alignItems="center"
backgroundColor="#F89F1B"
p={4}
flexDirection="row"
justifyContent={"flex-start"}
>
<Image
source={require('./src/assets/images/leetcode.png')}
alt="LeetCode"
size={8}
marginRight={2}
/>
<Text
fontSize="xl"
fontWeight="bold"
color={`${isDarkMode ? "black" : "white"}`}
>LeetCode</Text>
</Box>
<Tab.Navigator
screenOptions={{
tabBarStyle: {
backgroundColor: "#F89F1B",
},
tabBarActiveTintColor: "white",
tabBarInactiveTintColor: "black",
}
}
>
<Tab.Screen name="Home" component={Home}
options={{
headerShown: false,
tabBarIcon: ({ color, size }) => (
<Icon name="home" color={color} size={size} />
),
}}
/>
<Tab.Screen name="About" component={About}
options={{
headerShown: false,
tabBarIcon: ({ color, size }) => (
<Icon name="info-outline" color={color} size={size} />
),
}}
/>
</Tab.Navigator>
</NativeBaseProvider>
</NavigationContainer>
);
}
export default App;