Skip to content
This repository was archived by the owner on Nov 3, 2025. It is now read-only.

Commit b07592d

Browse files
committed
♻️ (CardSkewUp) rename CardSkewUp into ConvexUp
1 parent 8889cfa commit b07592d

5 files changed

Lines changed: 34 additions & 24 deletions

File tree

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React, { Children } from 'react';
2-
import { StyleSheet, Dimensions } from 'react-native';
2+
import { StyleSheet, Dimensions, TouchableWithoutFeedback, View } from 'react-native';
33
import Animated, { Easing } from 'react-native-reanimated';
44

55
import { TransitionComponent } from './Transition';
6+
import { Navigation } from 'react-gondola/Navigation';
67

78
const { height: SCREEN_HEIGHT } = Dimensions.get('window');
89

@@ -67,7 +68,7 @@ function runTiming(
6768
]);
6869
}
6970

70-
export class CardSkewUp extends TransitionComponent {
71+
export class ConvexUp extends TransitionComponent {
7172
state = {
7273
hidden: !this.props.directionForward,
7374
};
@@ -94,26 +95,35 @@ export class CardSkewUp extends TransitionComponent {
9495

9596
render() {
9697
return (
97-
<Animated.View
98-
pointerEvents={this.state.hidden ? 'none' : 'auto'}
99-
style={[
100-
StyleSheet.absoluteFill,
101-
{ backgroundColor: '#000000aa', alignItems: 'center', justifyContent: 'center' },
102-
{ opacity: sub(new Value(1), this.trans) },
103-
]}
104-
>
98+
<View style={[StyleSheet.absoluteFill]} pointerEvents={this.state.hidden ? 'none' : 'auto'}>
10599
<Animated.View
106-
style={{
107-
transform: [
108-
{ perspective: 500 },
109-
{ rotateX: multiply(this.trans, -0.5) },
110-
{ translateY: multiply(this.trans, SCREEN_HEIGHT / 2) },
111-
],
112-
}}
100+
style={[StyleSheet.absoluteFill, { opacity: sub(new Value(1), this.trans) }]}
113101
>
114-
{!this.state.hidden && Children.only(this.props.children)}
102+
<TouchableWithoutFeedback
103+
onPress={Navigation.instance.backHandlerDelegate.back}
104+
style={StyleSheet.absoluteFill}
105+
>
106+
<View style={[StyleSheet.absoluteFill, { backgroundColor: '#000000aa' }]}></View>
107+
</TouchableWithoutFeedback>
115108
</Animated.View>
116-
</Animated.View>
109+
<View
110+
style={[StyleSheet.absoluteFill, { alignItems: 'center', justifyContent: 'center' }]}
111+
pointerEvents="box-none"
112+
>
113+
<Animated.View
114+
style={{
115+
opacity: sub(new Value(1), this.trans),
116+
transform: [
117+
{ perspective: 500 },
118+
{ rotateX: multiply(this.trans, -0.5) },
119+
{ translateY: multiply(this.trans, SCREEN_HEIGHT / 2) },
120+
],
121+
}}
122+
>
123+
{!this.state.hidden && Children.only(this.props.children)}
124+
</Animated.View>
125+
</View>
126+
</View>
117127
);
118128
}
119129
}

src/transitions/__tests__/CardSkewUp.test.tsx

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { describeTransitioner } from '../utils/describeTransitioner';
2+
import { ConvexUp } from '../ConvexUp';
3+
4+
describeTransitioner(ConvexUp);

src/transitions/__tests__/__snapshots__/CardSkewUp.test.tsx.snap renamed to src/transitions/__tests__/__snapshots__/ConvexUp.test.tsx.snap

File renamed without changes.

src/transitions/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export { None } from './None';
22
export { SlideLeft } from './SlideLeft';
33
export { SlideUp } from './SlideUp';
44
export { RotateCrazy } from './RotateCrazy';
5-
export { CardSkewUp } from './CardSkewUp';
5+
export { ConvexUp } from './ConvexUp';
66
export { TransitionComponent } from './Transition';
77

88
// test utility

0 commit comments

Comments
 (0)