-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.js
115 lines (109 loc) · 3.21 KB
/
index.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import {Navigation} from 'react-native-navigation';
import {gestureHandlerRootHOC} from 'react-native-gesture-handler';
import {TopBarButton} from './components/icons/TopBarButton';
import {Author} from './views/author/Author';
import {Report} from './views/report/Report';
import {CameraEventClip} from './views/camera-event-clip/CameraEventClip';
import {CameraPreview} from './views/camera-preview/CameraPreview';
import {CameraEvents} from './views/camera-events/CameraEvents';
import {CamerasList} from './views/cameras-list/CamerasList';
import {EventsFilters} from './views/events-filters/EventsFilters';
import {Menu} from './views/menu/Menu';
import {Settings} from './views/settings/Settings';
import {withRedux} from './helpers/redux';
import {withTranslations} from './helpers/locale';
import {Logs} from './views/logs/Logs';
import {Storage} from './views/storage/Storage';
import {System} from './views/system/System';
import {ServerForm} from './views/settings/ServerForm';
const registerComponent = (name, component, decorators = []) => {
Navigation.registerComponent(
name,
() =>
decorators.reduce(
(decoratedComponent, decorator) => decorator(decoratedComponent),
component,
),
() => component,
);
};
const viewDecorators = [gestureHandlerRootHOC, withTranslations, withRedux];
registerComponent('CamerasList', CamerasList, viewDecorators);
registerComponent('CameraEvents', CameraEvents, viewDecorators);
registerComponent('CameraEventClip', CameraEventClip, viewDecorators);
registerComponent('CameraPreview', CameraPreview, viewDecorators);
registerComponent('Storage', Storage, viewDecorators);
registerComponent('System', System, viewDecorators);
registerComponent('Logs', Logs, viewDecorators);
registerComponent('Settings', Settings, viewDecorators);
registerComponent('ServerForm', ServerForm, viewDecorators);
registerComponent('Author', Author, viewDecorators);
registerComponent('Report', Report, viewDecorators);
registerComponent('Menu', Menu, [
gestureHandlerRootHOC,
withTranslations,
withRedux,
]);
registerComponent('EventsFilters', EventsFilters, [
withTranslations,
withRedux,
]);
registerComponent('TopBarButton', TopBarButton);
Navigation.events().registerAppLaunchedListener(() => {
Navigation.setRoot({
root: {
sideMenu: {
center: {
stack: {
id: 'MainMenu',
children: [
{
component: {
name: 'CamerasList',
},
},
],
},
},
left: {
component: {
id: 'Menu',
name: 'Menu',
},
},
right: {
component: {
id: 'EventsFilters',
name: 'EventsFilters',
},
},
options: {
sideMenu: {
left: {
enabled: false,
},
right: {
enabled: false,
},
},
},
},
},
});
});
Navigation.setDefaultOptions({
statusBar: {
backgroundColor: 'black',
},
topBar: {
title: {
color: 'white',
},
backButton: {
color: 'white',
},
background: {
color: 'black',
},
},
});