-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
executable file
·42 lines (37 loc) · 1.34 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
import React, { Component } from 'react';
import { AppRegistry } from 'react-native';
import { Navigator } from 'react-native-deprecated-custom-components';
import HomeScreen from './components/HomeScreen';
import PosterConfigScreen from './components/PosterConfigScreen';
import PosterListScreen from './components/PosterListScreen';
import PosterConfirmationScreen from './components/PosterConfirmationScreen';
import CheckoutScreen from './components/CheckoutScreen';
export default class Posterific extends Component {
renderScene(route, navigator) {
if (route.name === 'Home') {
return <HomeScreen navigator={navigator} />
}
if (route.name === 'PosterList') {
return <PosterListScreen navigator={navigator} />
}
if (route.name === 'PosterConfig') {
return <PosterConfigScreen navigator={navigator} {...route.passProps} />
}
if (route.name === 'PosterConfirmation') {
return <PosterConfirmationScreen navigator={navigator} {...route.passProps} />
}
if (route.name === 'Checkout') {
return <CheckoutScreen navigator={navigator} {...route.passProps} />
}
}
render() {
return (
<Navigator
style={{ flex: 1 }}
initialRoute={{ name: 'Home' }}
renderScene={this.renderScene}
/>
)
}
}
AppRegistry.registerComponent('posterific', () => Posterific);