-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDestinations.js
270 lines (234 loc) · 7.12 KB
/
Destinations.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
/**
* 'Destinations' screen for 'Bottom-Navigation' sample app.
*/
'use strict';
/* --- Imports --- */
import React, {
Component,
PropTypes
} from 'react';
const ReactNative = require('react-native');
const {
StyleSheet,
ScrollView,
View,
Text,
Image,
} = ReactNative;
/* --- Class methods --- */
class Destinations extends Component {
onTabSelected() {
this.refs.scrollView.scrollTo({x: 0, y: -25, animated: false});
this.refs.scrollView.scrollTo({x: 0, y: 0, animated: true});
}
onScrollToTop() {
this.refs.scrollView.scrollTo({x: 0, y: 0, animated: true});
}
render() {
return (
<ScrollView ref="scrollView" style={{flex: 1, alignSelf: 'stretch'}}>
<View style={styles.box}>
<Image
style={styles.drawer}
source={require('./icons/ic_drawer.png')}
/>
<Text style={styles.search}>
Search
</Text>
</View>
<View style={styles.card}>
<Image
style={styles.image}
source={require('./images/img_seychelles.jpg')}
resizeMode="cover"
/>
<Text style={styles.title}>
Seychelles
</Text>
<Text style={styles.description}>
Spread across 175 square miles of the Indian Ocean, this chain of 115 islands has become (slightly) more accessible with the introduction of Crystal Cruises’ first small-capacity yacht, Crystal Esprit.
</Text>
<Text style={styles.readmore}>
READ MORE
</Text>
</View>
<View style={styles.card}>
<Image
style={styles.image}
source={require('./images/img_scotland.jpg')}
resizeMode="cover"
/>
<Text style={styles.title}>
Scotland
</Text>
<Text style={styles.description}>
The launch of Scotland’s North Coast 500 loop has opened up the country’s Highlands and northernmost shores in a new and much more accessible way. Intrepid travelers can now explore its rural and rugged landscapes by car, bicycle or even on foot.
</Text>
<Text style={styles.readmore}>
READ MORE
</Text>
</View>
<View style={styles.card}>
<Image
style={styles.image}
source={require('./images/img_cartagena.jpg')}
resizeMode="cover"
/>
<Text style={styles.title}>
Cartagena, Colombia
</Text>
<Text style={styles.description}>
Cartagena, on the Caribbean coast, boasts colorful colonial architecture and fantastic food, but its vibrant arts scene is often overlooked. This January brings the 10th incarnation of the Classical Music Festival, followed by the Southern Hemisphere edition of the U.K.’s literary Hay Festival.
</Text>
<Text style={styles.readmore}>
READ MORE
</Text>
</View>
<View style={styles.card}>
<Image
style={styles.image}
source={require('./images/img_australia.jpg')}
resizeMode="cover"
/>
<Text style={styles.title}>
Australia
</Text>
<Text style={styles.description}>
Now’s your chance to delve deeply into indigenous customs across the continent — beyond the Red Centre and Outback — through projects and companies owned by the aboriginal tribes.
</Text>
<Text style={styles.readmore}>
READ MORE
</Text>
</View>
<View style={styles.card}>
<Image
style={styles.image}
source={require('./images/img_mykonos.jpg')}
resizeMode="cover"
/>
<Text style={styles.title}>
Mykonos, Greece
</Text>
<Text style={styles.description}>
While the uncertainties of Greece’s economy and the ongoing migrant crisis might have dampened the desire of some travelers to plan an Aegean holiday, the party never stopped on Mykonos.
</Text>
<Text style={styles.readmore}>
READ MORE
</Text>
</View>
<View style={styles.card}>
<Image
style={styles.image}
source={require('./images/img_new_plymouth.jpg')}
resizeMode="cover"
/>
<Text style={styles.title}>
New Plymouth, New Zealand
</Text>
<Text style={styles.description}>
This port city on the west coast of the North Island offers an intriguing mix of culture, architecture and contemporary art, including the Len Lye Museum, named for and devoted to one of NZ’s most famous artists.
</Text>
<Text style={styles.readmore}>
READ MORE
</Text>
</View>
<View style={styles.card}>
<Image
style={styles.image}
source={require('./images/img_sri_lanka.jpg')}
resizeMode="cover"
/>
<Text style={styles.title}>
Sri Lanka
</Text>
<Text style={styles.description}>
Sri Lanka is becoming an easier place to navigate: Enhanced infrastructure has increased connectivity between the capital of Colombo, the old town ofGalle, a UNESCO World Heritage site, and Yale National Park in the south — plus the recently revived Queen of Jaffna train also links Colombo to the north.
</Text>
<Text style={styles.readmore}>
READ MORE
</Text>
</View>
</ScrollView>
)
}
}
/* --- Stylesheet --- */
const styles = StyleSheet.create({
card: {
alignSelf: 'stretch',
justifyContent: 'center',
marginLeft: 12,
marginRight: 12,
marginBottom: 16,
borderRadius: 4,
shadowColor: 'rgba(0, 0, 0, 0.2)',
shadowOpacity: 0.8,
shadowRadius: 2,
shadowOffset: {
height: 1,
width: 2,
},
backgroundColor: '#FFFFFF',
},
box: {
flexDirection: 'row',
alignSelf: 'stretch',
marginLeft: 12,
marginRight: 12,
marginTop: 16,
marginBottom: 16,
paddingLeft: 16,
paddingRight: 16,
paddingTop: 12,
paddingBottom: 14,
borderRadius: 4,
shadowColor: 'rgba(0, 0, 0, 0.2)',
shadowOpacity: 0.8,
shadowRadius: 2,
shadowOffset: {
height: 1,
width: 2,
},
backgroundColor: '#FFFFFF',
},
drawer: {
marginRight: 16,
marginTop: 5,
tintColor: '#808080'
},
image: {
width: null,
height: 200,
overflow: 'hidden',
borderRadius: 2,
},
search: {
fontSize: 18,
color: '#999999'
},
title: {
marginLeft: 16,
marginRight: 16,
marginTop: 16,
marginBottom: 12,
fontSize: 18,
fontWeight: 'bold',
color: '#00796B'
},
description: {
marginLeft: 16,
marginRight: 16,
marginBottom: 14,
fontSize: 13,
},
readmore: {
marginLeft: 16,
marginRight: 16,
marginBottom: 16,
fontSize: 12,
fontWeight: 'bold',
color: '#003879'
},
});
/* --- Module exports --- */
module.exports = Destinations;