-
Notifications
You must be signed in to change notification settings - Fork 312
/
Copy pathMain.js
57 lines (51 loc) · 2.02 KB
/
Main.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
/**
* This is the Main file
* This file contains the routes of all the pages
**/
// React native and others libraries imports
import React, { Component } from 'react';
import { BackHandler } from 'react-native';
import { Root } from 'native-base';
import { Scene, Router, Actions } from 'react-native-router-flux';
// Our custom files and classes import
import Home from './page/Home';
import Search from './page/Search';
import Cart from './page/Cart';
import WishList from './page/WishList';
import Map from './page/Map';
import Newsletter from './page/Newsletter';
import Contact from './page/Contact';
import Category from './page/Category';
import Product from './page/Product';
import ImageGallery from './page/ImageGallery';
import Login from './page/Login';
import Signup from './page/Signup';
import Checkout from './page/Checkout';
export default class Main extends Component {
componentWillMount = () => {
BackHandler.addEventListener('hardwareBackPress', () => Actions.pop());
};
render() {
return(
<Root>
<Router>
<Scene key="root">
<Scene initial key="home" component={Home} hideNavBar />
<Scene key="search" component={Search} modal hideNavBar />
<Scene key="cart" component={Cart} modal hideNavBar />
<Scene key="wishlist" component={WishList} modal hideNavBar />
<Scene key="map" component={Map} modal hideNavBar />
<Scene key="contact" component={Contact} modal hideNavBar />
<Scene key="newsletter" component={Newsletter} modal hideNavBar />
<Scene key="category" component={Category} hideNavBar />
<Scene key="product" component={Product} hideNavBar />
<Scene key="imageGallery" component={ImageGallery} modal hideNavBar />
<Scene key="login" component={Login} hideNavBar />
<Scene key="signup" component={Signup} hideNavBar />
<Scene key="checkout" component={Checkout} hideNavBar />
</Scene>
</Router>
</Root>
);
}
}