-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNavigationComponents.js
More file actions
162 lines (153 loc) · 3.62 KB
/
NavigationComponents.js
File metadata and controls
162 lines (153 loc) · 3.62 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
import React from 'react';
import {View, Text, Alert, TouchableOpacity} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialIcons';
import Icon2 from 'react-native-vector-icons/Ionicons';
import { Navigation } from 'react-native-navigation';
import SessionStore from './SessionStore'
import Realm from './realm';
import {goInitializing} from './screens/helpers/Navigation';
const homeTopBar = () => (
<View
style={{
flex: 1,
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#fff',
padding : 2
}}
>
<Text style={{color : '#514A9D', fontSize : 18, margin : 4, textAlign : 'center', marginLeft : 10, marginRight : 10}}>Creator's Studio</Text>
</View>
);
const archiveIcon = () => (
<TouchableOpacity
style={{
padding : 5,
}}
onPress={
() => {
Navigation.showModal({
component: {
name: 'Archive Screen',
options: {
topBar: {
visible: false
}
}
}
});
}
}
>
<Icon size={25} style={{ color: '#514A9D' }} name="archive"/>
</TouchableOpacity>
);
const createEventIcon = () => (
<TouchableOpacity
style={{
padding : 5,
}}
onPress={
() => {
Navigation.showModal({
component: {
name: 'Create Event Screen',
options: {
topBar: {
visible: false
}
}
}
});
}
}
>
<Icon2 size={25} style={{ color: '#514A9D' }} name="ios-create"/>
</TouchableOpacity>
);
const helpStoryIcon = () => (
<TouchableOpacity
style={{
padding : 5,
}}
onPress={
() => {
Realm.getRealm((realm)=>{
realm.write(async () => {
realm.deleteAll();
await new SessionStore().reset();
goInitializing();
});
});
}
}
>
<Icon2 size={25} style={{ color: '#514A9D' }} name="md-help-circle"/>
</TouchableOpacity>
);
const settingsIcon = () => (
<TouchableOpacity
style={{
padding : 5,
}}
onPress={
() => {
Navigation.showModal({
component: {
name: 'Settings Screen',
passProps: {
},
options: {
topBar: {
visible: false
}
}
}
});
}
}
>
<Icon2 size={25} style={{ color: '#514A9D' }} name="md-settings"/>
</TouchableOpacity>
);
const doneStoryIcon = () => (
<TouchableOpacity
style={{
padding : 5,
}}
onPress={
() => {
const active = new SessionStore().getValueTemp('active');
if(active !== null){
const data = active.exportData();
if(data.empty) return Alert.alert('Create A Story', 'Fill data to procedd.');
Navigation.showModal({
component: {
name: 'Submit Story',
passProps: {
data
},
options: {
topBar: {
visible: false
}
}
}
});
}
}
}
>
<Icon2 size={25} style={{ color: '#514A9D' }} name="md-checkmark-circle"/>
</TouchableOpacity>
);
const navigationComponents = {
HOME_TOP_BAR : homeTopBar,
ARCHIVE_ICON : archiveIcon,
CREATE_EVENT_ICON : createEventIcon,
HELP_STORY_ICON : helpStoryIcon,
SETTINGS_ICON : settingsIcon,
DONE_STORY_ICON : doneStoryIcon
}
export default navigationComponents;