@@ -5,11 +5,7 @@ import LinearGradient from 'react-native-linear-gradient';
55import Icon from 'react-native-vector-icons/FontAwesome5' ;
66import { PlayerModule } from '../module/PlayerModule' ;
77
8- export const MovieCard = ( props : {
9- imageUri : string ;
10- episode : string ;
11- progress : number ;
12- } ) => (
8+ export const MovieCard = ( props : { movie : any } ) => (
139 < View
1410 style = { {
1511 backgroundColor : '#111111' ,
@@ -25,27 +21,30 @@ export const MovieCard = (props: {
2521 marginHorizontal : 5 ,
2622 } } >
2723 < TouchableOpacity
28- onPress = { PlayerModule . playMovie }
24+ onPress = { ( ) => PlayerModule . playMovie ( props . movie ) }
25+ disabled = { ! props . movie . available }
2926 style = { {
3027 height : 140 ,
3128 width : 100 ,
3229 borderRadius : 10 ,
33- backgroundColor : 'red ' ,
30+ backgroundColor : '#222222 ' ,
3431 overflow : 'hidden' ,
3532 } } >
3633 < Image
3734 style = { StyleSheet . absoluteFill }
3835 source = { {
39- uri : props . imageUri ,
36+ uri : props . movie . imageUri ,
4037 priority : Image . priority . normal ,
4138 } }
4239 resizeMode = { Image . resizeMode . cover }
4340 />
4441 < View
45- style = { {
46- ...StyleSheet . absoluteFill ,
47- justifyContent : 'flex-end' ,
48- } } >
42+ style = { [
43+ StyleSheet . absoluteFill ,
44+ {
45+ justifyContent : 'flex-end' ,
46+ } ,
47+ ] } >
4948 < LinearGradient colors = { [ '#00000000' , '#000000CC' ] } >
5049 < Text
5150 style = { {
@@ -55,50 +54,60 @@ export const MovieCard = (props: {
5554 marginLeft : 10 ,
5655 paddingVertical : 10 ,
5756 } } >
58- { props . episode }
57+ { props . movie . episode }
5958 </ Text >
6059 < View style = { { backgroundColor : '#444444' , height : 4 } } >
6160 < View
6261 style = { {
6362 flex : 1 ,
6463 backgroundColor : '#e30612' ,
65- width : `${ props . progress * 100 } %` ,
64+ width : `${ props . movie . progress * 100 } %` ,
6665 } }
6766 />
6867 </ View >
6968 </ LinearGradient >
7069 </ View >
71- < View
72- style = { {
73- ...StyleSheet . absoluteFill ,
74- justifyContent : 'center' ,
75- alignItems : 'center' ,
76- } } >
70+ { props . movie . available ? (
7771 < View
78- style = { {
79- width : 50 ,
80- height : 50 ,
81- justifyContent : 'center' ,
82- alignItems : 'center' ,
83- backgroundColor : '#FFFFFF' ,
84- borderRadius : 25 ,
85- shadowColor : '#000' ,
86- shadowOffset : {
87- width : 0 ,
88- height : 1 ,
72+ style = { [
73+ StyleSheet . absoluteFill ,
74+ {
75+ justifyContent : 'center' ,
76+ alignItems : 'center' ,
8977 } ,
90- shadowOpacity : 0.22 ,
91- shadowRadius : 2.22 ,
92- elevation : 3 ,
93- } } >
94- < Icon
95- name = "play"
96- size = { 18 }
97- color = "#000000"
98- style = { { paddingLeft : 4 } }
99- />
78+ ] } >
79+ < View
80+ style = { {
81+ width : 50 ,
82+ height : 50 ,
83+ justifyContent : 'center' ,
84+ alignItems : 'center' ,
85+ backgroundColor : '#FFFFFF' ,
86+ borderRadius : 25 ,
87+ shadowColor : '#000' ,
88+ shadowOffset : {
89+ width : 0 ,
90+ height : 1 ,
91+ } ,
92+ shadowOpacity : 0.22 ,
93+ shadowRadius : 2.22 ,
94+ elevation : 3 ,
95+ } } >
96+ < Icon
97+ name = "play"
98+ size = { 18 }
99+ color = "#000000"
100+ style = { { paddingLeft : 4 } }
101+ />
102+ </ View >
100103 </ View >
101- </ View >
104+ ) : (
105+ < View
106+ style = { [
107+ StyleSheet . absoluteFill ,
108+ { backgroundColor : '#000000' , opacity : 0.7 } ,
109+ ] } > </ View >
110+ ) }
102111 </ TouchableOpacity >
103112 </ View >
104113) ;
0 commit comments