-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrossword1.js
170 lines (167 loc) · 5.42 KB
/
crossword1.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
import { View, Icon, Input } from 'native-base';
import React, { Component } from 'react';
import { Text, StyleSheet, Image, ScrollView, TouchableOpacity } from 'react-native';
import { Actions } from 'react-native-router-flux';
import AsyncStorage from '@react-native-community/async-storage';
const baseUrl = 'https://crossword-app-backend.herokuapp.com'
export default class componentName extends Component {
constructor(props) {
super(props);
this.state = {
crosswordpic: '',
id: '',
save: '',
Image: '',
count: 1,
}
this.crossword()
}
crossword = async () => {
//console.log('Data==================',)
await fetch('https://crossword-app-backend.herokuapp.com/app/crossword/42/', {
method: 'POST',
headers: {
'Accept': 'application/json',
},
})
.then((response) => response.json())
.then((data) => {
//console.log('Data----+++++++++++++', data)
this.setState({
image: data?.crossword_picture,
})
})
}
render() {
return (
<View style={styles.container}>
<View style={styles.view1sty}>
<View style={styles.view2sty}>
<TouchableOpacity
onPress={() => Actions.Levels({ courseId: this.props?.courseId })}>
<Icon style={styles.lefticonsty} type='Entypo' name='chevron-thin-left' />
</TouchableOpacity>
</View>
<View style={styles.view3sty}>
<Text style={styles.text1sty}>الكلمات المتقاطعة</Text>
</View>
<View style={styles.view4sty}>
<Text style={styles.text2sty}>
1
</Text>
<Icon style={styles.stariconsty} type='Entypo' name='star' />
</View>
</View>
<View>
<Image
source={{ uri: baseUrl + this.state.image }}
style={styles.imagesty}
/>
</View>
<View style={styles.buttonviewsty}>
<TouchableOpacity
onPress={() => Actions.crossword4({ param: '1-Down', order: 5 })}
style={styles.inputrowview}>
<Text style={{ fontSize: 18, color: '#fff' }}>Down-1</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => Actions.crossword4({ param: '2-Down', order: 6 })}
style={styles.inputrowview}>
<Text style={{ fontSize: 18, color: '#fff' }}>Down-2</Text>
</TouchableOpacity>
</View>
<View style={styles.buttonviewsty}>
<TouchableOpacity
onPress={() => Actions.crossword4({ param: '3-Across', order: 7 })}
style={styles.inputrowview}>
<Text style={{ fontSize: 18, color: '#fff' }}>Across-3</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => Actions.crossword4({ param: '4-Across', order: 8 })}
style={styles.inputrowview}>
<Text style={{ fontSize: 18, color: '#fff' }}>Across-4</Text>
</TouchableOpacity>
</View>
</View>
);
}
}
let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#AED0EE',
alignItems: 'center'
},
stariconsty: {
color: '#FFD800',
fontSize: 35,
marginBottom: '5%'
},
view1sty: {
flexDirection: 'row',
width: '100%',
height: 75,
},
view2sty: {
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
width: '23%',
height: 75,
backgroundColor: '#59A9C2'
},
view3sty: {
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
width: '54%',
height: 75,
backgroundColor: '#114E76'
},
view4sty: {
flexDirection: 'row',
justifyContent: 'space-around',
alignItems: 'center',
width: '23%',
height: 75,
backgroundColor: '#59A9C2'
},
lefticonsty: {
color: '#007A3D',
fontSize: 50,
color: '#FFD800',
marginBottom: '5%'
},
text1sty: {
fontSize: 25,
color: 'white'
},
text2sty: {
fontSize: 25,
color: 'white'
},
imagesty: {
marginTop: '5%',
width: 300,
height: 300,
},
inputrowview: {
height: 70,
width: '30%',
borderWidth: .6,
borderRadius: 10,
borderColor: '#707070',
backgroundColor: '#114E76',
justifyContent: 'center',
alignItems: 'center',
alignSelf: 'center'
},
buttonviewsty: {
flexDirection: 'row',
width: '72%',
height: 70,
alignItems: 'center',
justifyContent: 'space-between',
marginTop: '10%'
}
});