123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- // @ts-check
- const Navigation = require('./services/Navigation');
- const { registerScreens } = require('./screens');
- const { Platform } = require('react-native');
- const { setDefaultOptions } = require('./commons/Options')
- const testIDs = require('./testIDs');
- const Screens = require('./screens/Screens');
-
- if (Platform.OS === 'android') {
- alert = (title, message) => Navigation.showOverlay({
- component: {
- name: Screens.Alert,
- passProps: {
- title,
- message
- }
- }
- });
- };
-
- function start() {
- registerScreens();
- Navigation.events().registerAppLaunchedListener(async () => {
- setDefaultOptions();
- setRoot();
- // showSETModal();
- });
- }
-
- function setRoot() {
- Navigation.setRoot({
- root: {
- bottomTabs: {
- children: [
- {
- stack: {
- children: [
- {
- component: {
- name: 'Layouts'
- }
- }
- ],
- options: {
- bottomTab: {
- text: 'Layouts',
- icon: require('../img/layouts.png'),
- selectedIcon: require('../img/layouts_selected.png'),
- testID: testIDs.LAYOUTS_TAB
- }
- }
- }
- },
- {
- stack: {
- children: [
- {
- component: {
- name: 'Options'
- }
- }
- ],
- options: {
- topBar: {
- title: {
- text: 'Default Title'
- }
- },
- bottomTab: {
- text: 'Options',
- icon: require('../img/options.png'),
- selectedIcon: require('../img/options_selected.png'),
- testID: testIDs.OPTIONS_TAB
- }
- }
- }
- },
- {
- stack: {
- children: [
- {
- component: {
- name: 'Navigation'
- }
- }
- ]
- }
- }
- ]
- }
- }
- });
- }
-
- function showSETModal() {
- Navigation.showModal(Screens.CocktailsListScreen);
- }
-
- module.exports = {
- start
- };
|