Skip to content

Commit cce1b8a

Browse files
committed
Finish slide screen modals
1 parent 0a4722a commit cce1b8a

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

app/components/Modal/ModalComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const styles = StyleSheet.create({
4040
height: theme.buttons.smallHeight,
4141
},
4242
modal: {
43-
flex: 1,
43+
flex: 3 / 4,
4444
justifyContent: 'center',
4545
alignItems: 'center',
4646
backgroundColor: theme.colors.white,

app/screens/SlideScreen.tsx

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ const SlideScreen = () => {
2626
onBackButtonPress={() => setShowFirstModal(false)}
2727
swipeDirection="up"
2828
onSwipeComplete={() => setShowFirstModal(false)}
29+
hideModal={() => setShowFirstModal(false)}
2930
animationIn="slideInDown"
3031
animationOut="slideOutUp"
31-
hideModal={() => setShowFirstModal(false)}
32+
style={styles.topModal}
3233
/>
3334

3435
<ButtonComponent
@@ -41,9 +42,13 @@ const SlideScreen = () => {
4142
onBackButtonPress={() => setShowSecondModal(false)}
4243
swipeDirection="left"
4344
onSwipeComplete={() => setShowSecondModal(false)}
45+
hideModal={() => setShowSecondModal(false)}
4446
animationIn="slideInLeft"
47+
animationInTiming={800}
48+
backdropTransitionInTiming={800}
4549
animationOut="slideOutLeft"
46-
hideModal={() => setShowSecondModal(false)}
50+
animationOutTiming={800}
51+
backdropTransitionOutTiming={800}
4752
/>
4853

4954
<ButtonComponent
@@ -56,9 +61,13 @@ const SlideScreen = () => {
5661
onBackButtonPress={() => setShowThirdModal(false)}
5762
swipeDirection="right"
5863
onSwipeComplete={() => setShowThirdModal(false)}
59-
animationIn="slideInRight"
60-
animationOut="slideOutRight"
6164
hideModal={() => setShowThirdModal(false)}
65+
animationIn="bounceInRight"
66+
animationInTiming={500}
67+
animationOut="bounceOutRight"
68+
animationOutTiming={500}
69+
backdropOpacity={1}
70+
style={styles.rightModal}
6271
/>
6372

6473
<ButtonComponent
@@ -71,9 +80,10 @@ const SlideScreen = () => {
7180
onBackButtonPress={() => setShowFourthModal(false)}
7281
swipeDirection="down"
7382
onSwipeComplete={() => setShowFourthModal(false)}
74-
animationIn="slideInUp"
75-
animationOut="slideOutDown"
7683
hideModal={() => setShowFourthModal(false)}
84+
animationIn="bounceInUp"
85+
animationOut="bounceOutDown"
86+
style={styles.bottomModal}
7787
/>
7888
</View>
7989
);
@@ -103,6 +113,20 @@ const styles = StyleSheet.create({
103113
top: heigth - heigth / 5 - theme.buttons.standardHeight / 2,
104114
left: width / 2 - theme.buttons.standardWidth / 2,
105115
},
116+
topModal: {
117+
flex: 1 / 3,
118+
},
119+
rightModal: {
120+
flex: 1,
121+
},
122+
bottomModal: {
123+
height: 150,
124+
width: width - 20,
125+
position: 'absolute',
126+
bottom: -10,
127+
left: -10,
128+
borderRadius: 10,
129+
},
106130
});
107131

108132
export default SlideScreen;

0 commit comments

Comments
 (0)