Fix startup crash
This commit is contained in:
parent
00f9428972
commit
7d0df0e7ce
2 changed files with 21 additions and 14 deletions
|
@ -115,19 +115,9 @@ function getIntroScreens() {
|
|||
);
|
||||
}
|
||||
|
||||
function MainStackComponent(props: {
|
||||
showIntro: boolean;
|
||||
createTabNavigator: () => React.ReactElement;
|
||||
}) {
|
||||
const { showIntro, createTabNavigator } = props;
|
||||
if (showIntro) {
|
||||
return getIntroScreens();
|
||||
}
|
||||
function getRegularScreens(createTabNavigator: () => React.ReactElement) {
|
||||
return (
|
||||
<MainStack.Navigator
|
||||
initialRouteName={showIntro ? MainRoutes.Intro : MainRoutes.Main}
|
||||
headerMode={'screen'}
|
||||
>
|
||||
<>
|
||||
<MainStack.Screen
|
||||
name={MainRoutes.Main}
|
||||
component={createTabNavigator}
|
||||
|
@ -303,6 +293,21 @@ function MainStackComponent(props: {
|
|||
title: i18n.t('screens.feedback.title'),
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function MainStackComponent(props: {
|
||||
showIntro: boolean;
|
||||
createTabNavigator: () => React.ReactElement;
|
||||
}) {
|
||||
const { showIntro, createTabNavigator } = props;
|
||||
return (
|
||||
<MainStack.Navigator
|
||||
initialRouteName={showIntro ? MainRoutes.Intro : MainRoutes.Main}
|
||||
headerMode={'screen'}
|
||||
>
|
||||
{showIntro ? getIntroScreens() : getRegularScreens(createTabNavigator)}
|
||||
</MainStack.Navigator>
|
||||
);
|
||||
}
|
||||
|
@ -315,6 +320,8 @@ type PropsType = {
|
|||
export default function MainNavigator(props: PropsType) {
|
||||
const { preferences } = usePreferences();
|
||||
const showIntro = getPreferenceBool(PreferenceKeys.showIntro, preferences);
|
||||
console.log(preferences);
|
||||
|
||||
return (
|
||||
<MainStackComponent
|
||||
showIntro={showIntro !== false}
|
||||
|
|
|
@ -254,7 +254,7 @@ const ICONS: {
|
|||
normal: '',
|
||||
focused: '',
|
||||
},
|
||||
planning: {
|
||||
events: {
|
||||
normal: 'calendar-range-outline',
|
||||
focused: 'calendar-range',
|
||||
},
|
||||
|
@ -285,7 +285,7 @@ export default function TabNavigator(props: PropsType) {
|
|||
services: i18n.t('screens.services.title'),
|
||||
proxiwash: i18n.t('screens.proxiwash.title'),
|
||||
home: i18n.t('screens.home.title'),
|
||||
planning: i18n.t('screens.planning.title'),
|
||||
events: i18n.t('screens.planning.title'),
|
||||
planex: i18n.t('screens.planex.title'),
|
||||
};
|
||||
return (
|
||||
|
|
Loading…
Reference in a new issue