11import React , { Children } from 'react' ;
2- import { StyleSheet , Dimensions } from 'react-native' ;
2+ import { StyleSheet , Dimensions , TouchableWithoutFeedback , View } from 'react-native' ;
33import Animated , { Easing } from 'react-native-reanimated' ;
44
55import { TransitionComponent } from './Transition' ;
6+ import { Navigation } from 'react-gondola/Navigation' ;
67
78const { 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}
0 commit comments