|
| 1 | +import { StyleSheet, Text, View } from 'react-native'; |
| 2 | +import { useSafeAreaInsets } from 'react-native-safe-area-context'; |
| 3 | +import { EaseView } from 'react-native-ease'; |
| 4 | + |
| 5 | +export default function Issue45Modal() { |
| 6 | + const insets = useSafeAreaInsets(); |
| 7 | + |
| 8 | + return ( |
| 9 | + <View style={[styles.container, { paddingTop: insets.top + 24 }]}> |
| 10 | + <Text style={styles.heading}>Modal repro</Text> |
| 11 | + <Text style={styles.body}> |
| 12 | + Dismiss this screen. If the bug is present on Android, one or both card |
| 13 | + backgrounds disappear during the closing transition while the blue child |
| 14 | + remains visible. |
| 15 | + </Text> |
| 16 | + |
| 17 | + <View style={styles.cards}> |
| 18 | + <View style={styles.demo}> |
| 19 | + <Text style={styles.label}>Animated background</Text> |
| 20 | + <EaseView |
| 21 | + animate={{ backgroundColor: 'red' }} |
| 22 | + transition={{ type: 'timing', duration: 300 }} |
| 23 | + style={styles.card} |
| 24 | + > |
| 25 | + <View style={styles.child} /> |
| 26 | + </EaseView> |
| 27 | + </View> |
| 28 | + |
| 29 | + <View style={styles.demo}> |
| 30 | + <Text style={styles.label}>Style background</Text> |
| 31 | + <EaseView |
| 32 | + transition={{ type: 'timing', duration: 300 }} |
| 33 | + style={styles.card2} |
| 34 | + > |
| 35 | + <View style={styles.child} /> |
| 36 | + </EaseView> |
| 37 | + </View> |
| 38 | + </View> |
| 39 | + </View> |
| 40 | + ); |
| 41 | +} |
| 42 | + |
| 43 | +const styles = StyleSheet.create({ |
| 44 | + container: { |
| 45 | + flex: 1, |
| 46 | + alignItems: 'center', |
| 47 | + backgroundColor: '#1a1a2e', |
| 48 | + gap: 16, |
| 49 | + justifyContent: 'center', |
| 50 | + paddingHorizontal: 20, |
| 51 | + }, |
| 52 | + heading: { |
| 53 | + color: '#fff', |
| 54 | + fontSize: 22, |
| 55 | + fontWeight: '700', |
| 56 | + }, |
| 57 | + body: { |
| 58 | + color: '#aaaacc', |
| 59 | + fontSize: 14, |
| 60 | + lineHeight: 20, |
| 61 | + maxWidth: 340, |
| 62 | + textAlign: 'center', |
| 63 | + }, |
| 64 | + cards: { |
| 65 | + alignItems: 'center', |
| 66 | + gap: 16, |
| 67 | + marginTop: 12, |
| 68 | + }, |
| 69 | + demo: { |
| 70 | + alignItems: 'center', |
| 71 | + gap: 8, |
| 72 | + }, |
| 73 | + label: { |
| 74 | + color: '#8888aa', |
| 75 | + fontSize: 13, |
| 76 | + }, |
| 77 | + card: { |
| 78 | + alignItems: 'center', |
| 79 | + height: 100, |
| 80 | + justifyContent: 'center', |
| 81 | + width: 100, |
| 82 | + }, |
| 83 | + card2: { |
| 84 | + alignItems: 'center', |
| 85 | + backgroundColor: 'green', |
| 86 | + height: 100, |
| 87 | + justifyContent: 'center', |
| 88 | + width: 100, |
| 89 | + }, |
| 90 | + child: { |
| 91 | + backgroundColor: 'blue', |
| 92 | + height: 24, |
| 93 | + width: 24, |
| 94 | + }, |
| 95 | +}); |
0 commit comments