-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.js
120 lines (116 loc) · 3.55 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
116
117
118
119
120
import { Navigation } from 'react-native-navigation';
import { YellowBox } from 'react-native';
import RegisterScreens from './src/screens';
import DBOperations from './src/data-access/db-operations';
import Colors from './src/styles/colors';
import Fonts from './src/styles/fonts';
const musicIcon = require('./icons/music_topmargin_gray.png');
const bookIcon = require('./icons/book_topmargin_gray.png');
const textIcon = require('./icons/text_topmargin_gray.png');
YellowBox.ignoreWarnings([
'Require cycle:',
'Remote debugger',
// 'pure function',
]);
RegisterScreens();
Navigation.events().registerAppLaunchedListener(() => {
DBOperations.init().then(() => {
Navigation.setRoot({
root: {
bottomTabs: {
options: {
bottomTabs: {
animate: false,
backgroundColor: Colors.bottomTabsBackground,
currentTabIndex: 2,
drawBehind: true,
},
},
children: [{
stack: {
id: 'CurrentTuneStack',
options: {
topBar: {
visible: false,
height: 0,
}
},
children: [
{
component: {
name: 'CurrentTune',
id: 'CurrentTune', // needed for mergeoptions to toggle tabbar visibility
options: {
bottomTab: {
fontFamily: Fonts.default,
fontSize: 14,
text: 'Current Tune',
icon: musicIcon, // credit "feathericons",
}
}
},
},
]
}
}, // end stack
{ // begin stack
stack: {
id: 'BrowserStack',
options: {
topBar: {
visible: false,
height: 0,
}
},
children: [
{ // begin component
component: {
name: 'TopBrowser',
options: {
bottomTab: {
text: 'Browser',
icon: bookIcon,
fontFamily: Fonts.default,
fontSize: 14,
// would be cool to use closed book when you're not on collection tab, open book when you are on it:
// selectedIcon: require('./icons/book-open.png') // doesn't work?
}
}
},
} // end component
]// end children
}
}, // end stack
{ // begin stack
stack: {
id: 'InfoStack',
options: {
topBar: {
visible: false,
height: 0,
}
},
children: [
{ // begin component
component: {
name: 'Info',
options: {
bottomTab: {
text: 'Info',
fontFamily: Fonts.default,
fontSize: 14,
icon: textIcon
}
}
},
} // end component
]// end children
}
}]
}
}
});
}).catch((error) => {
throw error;
});
});