-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39074 from software-mansion-labs/hybrid-app-expla…
…nation-modal [HybridApp] Add explanation modal
- Loading branch information
Showing
22 changed files
with
310 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React, {useCallback} from 'react'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import Navigation from '@libs/Navigation/Navigation'; | ||
import variables from '@styles/variables'; | ||
import * as Welcome from '@userActions/Welcome'; | ||
import CONST from '@src/CONST'; | ||
import ROUTES from '@src/ROUTES'; | ||
import FeatureTrainingModal from './FeatureTrainingModal'; | ||
|
||
function ExplanationModal() { | ||
const {translate} = useLocalize(); | ||
|
||
const onConfirm = useCallback(() => { | ||
Welcome.completeHybridAppOnboarding(); | ||
|
||
// We need to check if standard NewDot onboarding is completed. | ||
Welcome.isOnboardingFlowCompleted({ | ||
onNotCompleted: () => { | ||
setTimeout(() => { | ||
Navigation.isNavigationReady().then(() => { | ||
Navigation.navigate(ROUTES.ONBOARDING_ROOT); | ||
}); | ||
}, variables.welcomeVideoDelay); | ||
}, | ||
}); | ||
}, []); | ||
|
||
return ( | ||
<FeatureTrainingModal | ||
title={translate('onboarding.explanationModal.title')} | ||
description={translate('onboarding.explanationModal.description')} | ||
secondaryDescription={translate('onboarding.explanationModal.secondaryDescription')} | ||
confirmText={translate('footer.getStarted')} | ||
videoURL={CONST.WELCOME_VIDEO_URL} | ||
onConfirm={onConfirm} | ||
/> | ||
); | ||
} | ||
|
||
ExplanationModal.displayName = 'ExplanationModal'; | ||
export default ExplanationModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/libs/Navigation/AppNavigator/Navigators/ExplanationModalNavigator.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {createStackNavigator} from '@react-navigation/stack'; | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import NoDropZone from '@components/DragAndDrop/NoDropZone'; | ||
import ExplanationModal from '@components/ExplanationModal'; | ||
import type {ExplanationModalNavigatorParamList} from '@libs/Navigation/types'; | ||
import SCREENS from '@src/SCREENS'; | ||
|
||
const Stack = createStackNavigator<ExplanationModalNavigatorParamList>(); | ||
|
||
function ExplanationModalNavigator() { | ||
return ( | ||
<NoDropZone> | ||
<View> | ||
<Stack.Navigator screenOptions={{headerShown: false, animationEnabled: true}}> | ||
<Stack.Screen | ||
name={SCREENS.EXPLANATION_MODAL.ROOT} | ||
component={ExplanationModal} | ||
/> | ||
</Stack.Navigator> | ||
</View> | ||
</NoDropZone> | ||
); | ||
} | ||
|
||
ExplanationModalNavigator.displayName = 'ExplanationModalNavigator'; | ||
|
||
export default ExplanationModalNavigator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.