Skip to content

Commit

Permalink
Drop cardStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
MaciejSWM committed Feb 29, 2024
1 parent e703a14 commit c1d6c96
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {createStackNavigator} from '@react-navigation/stack';
import React, {useMemo} from 'react';
import React from 'react';
import {View} from 'react-native';
import NoDropZone from '@components/DragAndDrop/NoDropZone';
import useOnboardingLayout from '@hooks/useOnboardingLayout';
Expand All @@ -15,15 +15,14 @@ const Stack = createStackNavigator<OnboardingModalNavigatorParamList>();

function OnboardingModalNavigator() {
const styles = useThemeStyles();
const screenOptions = useMemo(() => OnboardingModalNavigatorScreenOptions(styles), [styles]);
const {shouldUseNarrowLayout} = useOnboardingLayout();

return (
<NoDropZone>
<Overlay />
<View style={styles.onboardingNavigatorOuterView}>
<View style={styles.OnboardingNavigatorInnerView(shouldUseNarrowLayout)}>
<Stack.Navigator screenOptions={screenOptions}>
<Stack.Navigator screenOptions={OnboardingModalNavigatorScreenOptions()}>
<Stack.Screen
name={SCREENS.ONBOARDING.PERSONAL_DETAILS}
component={OnboardingPersonalDetails}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {createStackNavigator} from '@react-navigation/stack';
import React, {useMemo} from 'react';
import React from 'react';
import {View} from 'react-native';
import NoDropZone from '@components/DragAndDrop/NoDropZone';
import OnboardingWelcomeVideo from '@components/OnboardingWelcomeVideo';
Expand All @@ -14,15 +14,14 @@ const Stack = createStackNavigator<WelcomeVideoModalNavigatorParamList>();

function WelcomeVideoModalNavigator() {
const styles = useThemeStyles();
const screenOptions = useMemo(() => WelcomeVideoModalNavigatorScreenOptions(styles), [styles]);
const {shouldUseNarrowLayout} = useOnboardingLayout();

return (
<NoDropZone>
<Overlay />
<View style={styles.onboardingNavigatorOuterView}>
<View style={styles.WelcomeVideoNavigatorInnerView(shouldUseNarrowLayout)}>
<Stack.Navigator screenOptions={screenOptions}>
<Stack.Navigator screenOptions={WelcomeVideoModalNavigatorScreenOptions()}>
<Stack.Screen
name={SCREENS.WELCOME_VIDEO.ROOT}
component={OnboardingWelcomeVideo}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import type {StackNavigationOptions} from '@react-navigation/stack';
import {CardStyleInterpolators} from '@react-navigation/stack';
import type {ThemeStyles} from '@styles/index';

/**
* Modal stack navigator screen options generator function
* @returns The screen options object
*/
const OnboardingModalNavigatorScreenOptions = (themeStyles: ThemeStyles): StackNavigationOptions => ({
const OnboardingModalNavigatorScreenOptions = (): StackNavigationOptions => ({
headerShown: false,
animationEnabled: true,
gestureDirection: 'horizontal',
cardStyle: themeStyles.navigationOnboardingScreenCardStyle,
cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS,
presentation: 'transparentModal',
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import type {StackNavigationOptions} from '@react-navigation/stack';
import {CardStyleInterpolators} from '@react-navigation/stack';
import type {ThemeStyles} from '@styles/index';

/**
* Modal stack navigator screen options generator function
* @returns The screen options object
*/
const OnboardingModalNavigatorScreenOptions = (themeStyles: ThemeStyles): StackNavigationOptions => ({
const OnboardingModalNavigatorScreenOptions = (): StackNavigationOptions => ({
headerShown: false,
animationEnabled: true,
gestureDirection: 'horizontal',
cardStyle: themeStyles.navigationOnboardingScreenCardStyle,
cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS,
presentation: 'transparentModal',
});
Expand Down
6 changes: 0 additions & 6 deletions src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2757,12 +2757,6 @@ const styles = (theme: ThemeColors) =>
height: '100%',
},

navigationOnboardingScreenCardStyle: {
backgroundColor: 'transparent',
width: '100%',
height: '100%',
},

invisible: {
position: 'absolute',
opacity: 0,
Expand Down

0 comments on commit c1d6c96

Please sign in to comment.