forked from duhseekoh/demo-access-control-in-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
executable file
·91 lines (85 loc) · 2.42 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
79
80
81
82
83
84
85
86
87
88
89
90
91
import React, { Component } from "react";
import { Text, View, ScrollView, StyleSheet } from "react-native";
import { createStackNavigator } from "react-navigation";
import { Button } from "react-native-elements";
import { Constants } from "expo";
import BasicConditionalExampleApp from "./example-apps/basic-conditional/ExampleApp";
import AccessControlBasicExampleApp from "./example-apps/v1-access-control-basic/ExampleApp";
import AccessControlReduxExampleApp from "./example-apps/v2-access-control-redux/ExampleApp";
import AccessControlLogicExampleApp from "./example-apps/v3-access-control-logic/ExampleApp";
import { Card } from "react-native-elements";
const Splash = ({ navigation }) => (
<ScrollView style={styles.scrollView}>
<Text style={styles.paragraph}>
Below are various examples referenced in
https://medium.com/@duhseekoh/TODO
</Text>
<Card title="Example App 1: Basic Access Control">
<Button
title="Open"
onPress={() => navigation.navigate("AccessControlBasicExampleApp")}
/>
</Card>
<Card title="Example App 2: Redux Access Control">
<Button
title="Open"
onPress={() => navigation.navigate("AccessControlReduxExampleApp")}
/>
</Card>
<Card title="Example App 3: Custom Logic Access Control">
<Button
title="Open"
onPress={() => navigation.navigate("AccessControlLogicExampleApp")}
/>
</Card>
</ScrollView>
);
const Routes = createStackNavigator({
Splash: {
screen: Splash,
navigationOptions: {
title: 'Access Control Demo',
}
},
AccessControlBasicExampleApp: {
screen: AccessControlBasicExampleApp,
navigationOptions: {
title: 'Nuclear Plant: Basic Access Control',
}
},
AccessControlReduxExampleApp: {
screen: AccessControlReduxExampleApp,
navigationOptions: {
title: 'Nuclear Plant: Redux Access Control',
}
},
AccessControlLogicExampleApp: {
screen: AccessControlLogicExampleApp,
navigationOptions: {
title: 'Nuclear Plant: Custom Logic Access Control',
}
}
});
export default class App extends Component {
render() {
return (
<View style={styles.container}>
<Routes />
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
scrollView: {
flex: 1
},
paragraph: {
fontSize: 18,
fontWeight: "bold",
textAlign: "center",
color: "#34495e"
}
});