-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
39 lines (36 loc) · 1019 Bytes
/
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
import {Constants} from 'expo';
import React from 'react';
import {ScrollView, StyleSheet, View} from 'react-native';
import {NativeRouter, Route, Switch} from 'react-router-native';
import About from './About/About.js';
import Detail from './Detail/Detail.js';
import Home from './Home/Home';
import NavBar from './components/NavBar';
export default class App extends React.Component {
render() {
return (
<NativeRouter>
<View style={styles.container}>
<NavBar />
<ScrollView style={styles.kotak}>
<Switch>
<Route exact path="/" component={Home} />
<Route path="/about" component={About} />
<Route path="/item/:id" component={Detail} />
</Switch>
</ScrollView>
</View>
</NativeRouter>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
marginTop: Constants.statusBarHeight,
backgroundColor: '#00bfff',
},
kotak: {
paddingVertical: 20,
},
});