-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb2687a
commit 3b921d3
Showing
32 changed files
with
244 additions
and
979 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
29 changes: 21 additions & 8 deletions
29
src/libs/Navigation/AppNavigator/ModalNavigatorScreenOptions.ts
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 |
---|---|---|
@@ -1,19 +1,32 @@ | ||
import type {StackNavigationOptions} from '@react-navigation/stack'; | ||
import {CardStyleInterpolators} from '@react-navigation/stack'; | ||
import type {GestureDirection} from '@react-navigation/stack/lib/typescript/src/types'; | ||
import type {PlatformStackNavigationOptions} from '@libs/Navigation/PlatformStackNavigation/types'; | ||
import type {ThemeStyles} from '@styles/index'; | ||
|
||
/** | ||
* Modal stack navigator screen options generator function | ||
* @param themeStyles - The styles object | ||
* @returns The screen options object | ||
*/ | ||
const ModalNavigatorScreenOptions = (themeStyles: ThemeStyles, gestureDirection: GestureDirection = 'horizontal'): StackNavigationOptions => ({ | ||
headerShown: false, | ||
animationEnabled: true, | ||
gestureDirection, | ||
cardStyle: themeStyles.navigationScreenCardStyle, | ||
cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS, | ||
}); | ||
const ModalNavigatorScreenOptions = (themeStyles: ThemeStyles, gestureDirection: GestureDirection = 'horizontal'): PlatformStackNavigationOptions => { | ||
let universalGestureDirection: PlatformStackNavigationOptions['gestureDirection'] | undefined; | ||
let webGestureDirection: GestureDirection | undefined; | ||
if (gestureDirection === 'horizontal' || gestureDirection === 'vertical') { | ||
universalGestureDirection = gestureDirection; | ||
} else { | ||
webGestureDirection = gestureDirection; | ||
} | ||
|
||
return { | ||
headerShown: false, | ||
animation: 'slide_from_right', | ||
gestureDirection: universalGestureDirection, | ||
web: { | ||
cardStyle: themeStyles.navigationScreenCardStyle, | ||
cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS, | ||
gestureDirection: webGestureDirection, | ||
}, | ||
}; | ||
}; | ||
|
||
export default ModalNavigatorScreenOptions; |
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
6 changes: 3 additions & 3 deletions
6
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
6 changes: 3 additions & 3 deletions
6
src/libs/Navigation/AppNavigator/Navigators/FeatureTrainingModalNavigator.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
8 changes: 4 additions & 4 deletions
8
src/libs/Navigation/AppNavigator/Navigators/LeftModalNavigator.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
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
14 changes: 2 additions & 12 deletions
14
src/libs/Navigation/AppNavigator/Navigators/Overlay/index.native.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
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
6 changes: 3 additions & 3 deletions
6
src/libs/Navigation/AppNavigator/Navigators/WelcomeVideoModalNavigator.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
Oops, something went wrong.