|
@@ -115,19 +115,9 @@ function getIntroScreens() {
|
115
|
115
|
);
|
116
|
116
|
}
|
117
|
117
|
|
118
|
|
-function MainStackComponent(props: {
|
119
|
|
- showIntro: boolean;
|
120
|
|
- createTabNavigator: () => React.ReactElement;
|
121
|
|
-}) {
|
122
|
|
- const { showIntro, createTabNavigator } = props;
|
123
|
|
- if (showIntro) {
|
124
|
|
- return getIntroScreens();
|
125
|
|
- }
|
|
118
|
+function getRegularScreens(createTabNavigator: () => React.ReactElement) {
|
126
|
119
|
return (
|
127
|
|
- <MainStack.Navigator
|
128
|
|
- initialRouteName={showIntro ? MainRoutes.Intro : MainRoutes.Main}
|
129
|
|
- headerMode={'screen'}
|
130
|
|
- >
|
|
120
|
+ <>
|
131
|
121
|
<MainStack.Screen
|
132
|
122
|
name={MainRoutes.Main}
|
133
|
123
|
component={createTabNavigator}
|
|
@@ -303,6 +293,21 @@ function MainStackComponent(props: {
|
303
|
293
|
title: i18n.t('screens.feedback.title'),
|
304
|
294
|
}}
|
305
|
295
|
/>
|
|
296
|
+ </>
|
|
297
|
+ );
|
|
298
|
+}
|
|
299
|
+
|
|
300
|
+function MainStackComponent(props: {
|
|
301
|
+ showIntro: boolean;
|
|
302
|
+ createTabNavigator: () => React.ReactElement;
|
|
303
|
+}) {
|
|
304
|
+ const { showIntro, createTabNavigator } = props;
|
|
305
|
+ return (
|
|
306
|
+ <MainStack.Navigator
|
|
307
|
+ initialRouteName={showIntro ? MainRoutes.Intro : MainRoutes.Main}
|
|
308
|
+ headerMode={'screen'}
|
|
309
|
+ >
|
|
310
|
+ {showIntro ? getIntroScreens() : getRegularScreens(createTabNavigator)}
|
306
|
311
|
</MainStack.Navigator>
|
307
|
312
|
);
|
308
|
313
|
}
|
|
@@ -315,6 +320,8 @@ type PropsType = {
|
315
|
320
|
export default function MainNavigator(props: PropsType) {
|
316
|
321
|
const { preferences } = usePreferences();
|
317
|
322
|
const showIntro = getPreferenceBool(PreferenceKeys.showIntro, preferences);
|
|
323
|
+ console.log(preferences);
|
|
324
|
+
|
318
|
325
|
return (
|
319
|
326
|
<MainStackComponent
|
320
|
327
|
showIntro={showIntro !== false}
|