@momo-kits/foundation 0.164.1-beta.8 → 0.164.1-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -153,7 +153,7 @@ const TabScreen: React.FC<any> = ({ route, navigation }) => {
|
|
|
153
153
|
initialParams,
|
|
154
154
|
bottomTab: 'nested',
|
|
155
155
|
}}
|
|
156
|
-
options={{ ...getStackOptions() }}
|
|
156
|
+
options={{ ...getStackOptions({ swipeBack: false }) }}
|
|
157
157
|
/>
|
|
158
158
|
</Stack.Navigator>
|
|
159
159
|
</Animated.View>
|
|
@@ -188,7 +188,7 @@ const TabScreen: React.FC<any> = ({ route, navigation }) => {
|
|
|
188
188
|
initialParams,
|
|
189
189
|
bottomTab: 'default',
|
|
190
190
|
}}
|
|
191
|
-
options={{ ...getStackOptions(), ...options }}
|
|
191
|
+
options={{ ...getStackOptions({ swipeBack: false }), ...options }}
|
|
192
192
|
/>
|
|
193
193
|
</Stack.Navigator>
|
|
194
194
|
</NavigationContainer>
|
package/Application/utils.tsx
CHANGED
|
@@ -59,8 +59,10 @@ const forStackTransitionWithOverlay = (
|
|
|
59
59
|
/**
|
|
60
60
|
* default options for stack screen
|
|
61
61
|
*/
|
|
62
|
-
const getStackOptions = (
|
|
63
|
-
|
|
62
|
+
const getStackOptions = ({
|
|
63
|
+
swipeBack = true,
|
|
64
|
+
}: { swipeBack?: boolean } = {}): StackNavigationOptions => {
|
|
65
|
+
const base: StackNavigationOptions = {
|
|
64
66
|
headerTitleAlign: 'left',
|
|
65
67
|
headerTitle: props => <HeaderTitle {...props} />,
|
|
66
68
|
headerTitleContainerStyle: {
|
|
@@ -76,6 +78,25 @@ const getStackOptions = (): StackNavigationOptions => {
|
|
|
76
78
|
headerLeft: (props: any) => <HeaderLeft {...props} />,
|
|
77
79
|
headerRight: (props: any) => <HeaderRight {...props} />,
|
|
78
80
|
headerTintColor: Colors.black_17,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* A bottom tab stack holds a single route, so the card transition never runs and
|
|
85
|
+
* `CardContainer` pins `gestureEnabled` to false at index 0 regardless. What does bite is
|
|
86
|
+
* `cardOverlayEnabled`: `current.progress` rests at 1, so the overlay would sit at its full
|
|
87
|
+
* 0.6 forever instead of only during a push, tinting any tab screen that paints no
|
|
88
|
+
* background of its own. This branch is the option set from before swipe back, unchanged.
|
|
89
|
+
*/
|
|
90
|
+
if (!swipeBack) {
|
|
91
|
+
return {
|
|
92
|
+
...base,
|
|
93
|
+
gestureEnabled: false,
|
|
94
|
+
...TransitionPresets.SlideFromRightIOS,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
...base,
|
|
79
100
|
gestureEnabled: Platform.OS === 'ios',
|
|
80
101
|
...TransitionPresets.SlideFromRightIOS,
|
|
81
102
|
cardStyleInterpolator: forStackTransitionWithOverlay,
|