-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathComingSoonItem.js
147 lines (142 loc) · 4.14 KB
/
ComingSoonItem.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
import React from 'react';
import { useSpring, animated } from 'react-spring';
import { View, Image, Text, TouchableOpacity, FlatList, StyleSheet } from 'react-native';
import * as Icon from './Icon';
const AnimatedView = animated(View);
function CategorySeparator() {
return <View style={styles.categorySeparator} />;
}
export default function ComingSoonItem(props) {
const overlayStyle = useSpring({ opacity: props.disabled ? 1 : 0, from: { opacity: 1 } });
return (
<View style={styles.container}>
<View style={styles.imageWrapper}>
<Image
style={styles.image}
source={{ uri: `http://image.tmdb.org/t/p/w500/${props.backdrop_path}` }} />
</View>
<View style={styles.content}>
<View style={styles.header}>
<View style={styles.logoWrapper}>
<Text numberOfLines={2} style={styles.logoLabel}>{props.title}</Text>
</View>
<View style={styles.buttonContainer}>
<TouchableOpacity style={styles.button}>
<Icon.Plus />
<Text style={styles.buttonLabel}>My List</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button}>
<Icon.Share />
<Text style={styles.buttonLabel}>Share</Text>
</TouchableOpacity>
</View>
</View>
<Text style={styles.label}>Coming Wednesday</Text>
<Text style={styles.title}>{props.title}</Text>
<Text style={styles.overview} numberOfLines={3}>{props.overview}</Text>
<FlatList
ItemSeparatorComponent={CategorySeparator}
scrollEnabled={false}
horizontal
data={['Magical', 'Anime Feature', 'Fantasy Anime', 'Children & Family']}
renderItem={({ item }) => <Text style={styles.category}>{item}</Text>}
keyExtractor={item => item}
/>
</View>
<AnimatedView
style={[styles.overlay, overlayStyle]}
pointerEvents={props.disabled ? 'auto' : 'none'} />
</View>
);
}
ComingSoonItem.defaultProps = {
disabled: false,
};
const styles = StyleSheet.create({
container: {
//
},
overlay: {
position: 'absolute',
height: '100%',
width: '100%',
backgroundColor: 'rgba(0,0,0,0.7)',
},
imageWrapper: {
marginVertical: 15,
},
image: {
height: 203,
width: '100%',
},
content: {
paddingHorizontal: 10,
paddingBottom: 25
},
topContent: {
height: 70,
},
label: {
fontSize: 14,
color: '#929292',
marginBottom: 12,
},
title: {
fontSize: 18,
fontWeight: 'bold',
color: '#FEFFFE',
marginBottom: 4,
},
overview: {
fontSize: 14,
lineHeight: 18,
color: '#929292',
marginBottom: 10,
},
category: {
fontSize: 11,
color: '#FFFFFF',
},
categorySeparator: {
marginHorizontal: 4,
height: 3,
width: 3,
borderRadius: 2,
backgroundColor: '#E50914',
alignSelf: 'center',
},
header: {
flexDirection: 'row',
height: 70,
},
buttonContainer: {
flexDirection: 'row',
alignItems: 'flex-start',
marginLeft: 'auto',
marginRight: 3,
},
button: {
padding: 12,
alignItems: 'center',
},
buttonLabel: {
fontSize: 10,
color: '#fff',
marginTop: 2,
},
logoWrapper: {
marginLeft: 10,
height: 60,
width: 120,
justifyContent: 'center',
alignItems: 'center',
},
logoLabel: {
textAlign: 'center',
fontSize: 19,
fontStyle: 'italic',
fontWeight: 'bold',
color: '#fff',
textTransform: 'uppercase',
}
});