-
Notifications
You must be signed in to change notification settings - Fork 1
/
ViewModal.js
111 lines (108 loc) · 3.08 KB
/
ViewModal.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import {View, Text, Modal, TouchableOpacity, StyleSheet} from 'react-native';
import React from 'react';
import AntDesign from 'react-native-vector-icons/AntDesign';
import {COLORS, SIZES, SPACING} from '../../utils/globalStyles';
import {ScrollView} from 'react-native-gesture-handler';
import {PrizeRules} from '.';
import Log from '../../helpers/Log';
export default function ViewDetailsModal({
modalVisible,
setModalVisible,
quiz,
}) {
return (
<Modal
animationType="dissolve"
transparent={true}
visible={modalVisible}
statusBarTranslucent={true}
onRequestClose={() => setModalVisible(false)}>
<TouchableOpacity
style={styles.modalBackground}
activeOpacity={1}
onPressOut={() => setModalVisible(false)}>
<View style={styles.modalContent}>
<TouchableOpacity
style={styles.closeButton}
onPress={() => setModalVisible(false)}>
<AntDesign name="close" size={28} color={COLORS.black} />
</TouchableOpacity>
<ScrollView>
<Text
allowFontScaling={false}
style={{...styles.font18, marginTop: 50}}>
Prize Scheme
</Text>
<View style={styles.contactContainer}>
<View
// style={styles.container}
contentContainerStyle={{paddingBottom: 100}}
showsVerticalScrollIndicator={false}>
<View style={styles.subContainer}>
{quiz?.prizesText?.map((item, index) => {
const myArray = item.split(':');
return (
<Text key={index} style={styles.prizeText}>
• {myArray[0]} {' - '}
<Text style={{fontWeight: '700', color: COLORS.BLUE}}>
{myArray[1]}
</Text>
</Text>
);
})}
</View>
<Text
allowFontScaling={false}
style={{...styles.font18, marginVertical: 16}}>
Rules
</Text>
<PrizeRules />
</View>
</View>
</ScrollView>
</View>
</TouchableOpacity>
</Modal>
);
}
const styles = StyleSheet.create({
subContainer: {
padding: SPACING.s10,
// marginBottom: 20,
},
font18: {
// marginTop: 50,
fontSize: SPACING.s20,
fontWeight: 'bold',
color: COLORS.black,
marginLeft: 10,
},
modalBackground: {
flex: 1,
backgroundColor: 'rgba(0, 0, 0, 0.5)',
alignItems: 'center',
justifyContent: 'center',
},
modalContent: {
backgroundColor: 'white',
paddingHorizontal: SIZES.large,
borderRadius: 10,
width: 350,
maxHeight: '75%',
},
contactContainer: {
marginVertical: 20,
},
closeButton: {
position: 'absolute',
top: 10,
right: 10,
},
prizeText: {
color: 'black',
marginBottom: 4,
lineHeight: 20,
fontWeight: '500',
fontSize: SPACING.s14,
},
});