-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
78 lines (69 loc) · 1.65 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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React, {useRef} from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
TextInput,
ImageBackground,
Dimensions,
TouchableOpacity,
} from 'react-native';
import store from './source/Redux/store';
import { Provider } from 'react-redux';
import ListItems from './source/Views/ListItems'
import { TabView, SceneMap } from 'react-native-tab-view';
const { width } = Dimensions.get('window');
const initialLayout = { width: Dimensions.get('window').width };
const FirstRoute = () => (
<View style={[styles.body, { backgroundColor: '#ff4081' }]} />
);
const SecondRoute = () => (
<View style={[styles.body, { backgroundColor: '#673ab7' }]} />
);
const ThirdRoute = () => (
<Provider store={store}>
<ListItems></ListItems>
</Provider>
);
const App: () => React$Node = () => {
const [index, setIndex] = React.useState(0);
const [routes] = React.useState([
{ key: 'first', title: 'Grid' },
{ key: 'second', title: 'List 1' },
{ key: 'thỉrd', title: 'List 2' },
]);
const renderScene = SceneMap({
first: FirstRoute,
second: SecondRoute,
thỉrd: ThirdRoute,
});
return (
<>
<StatusBar barStyle="dark-content" />
<SafeAreaView style={styles.body} >
<TabView
navigationState={{ index, routes }}
renderScene={renderScene}
onIndexChange={setIndex}
initialLayout={initialLayout}
/>
</SafeAreaView>
</>
);
};
const styles = StyleSheet.create({
body: {
flex: 1,
},
});
export default App;