Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. // components
  2. class VideoThumbnail extends React.Component {
  3. render() {
  4. return (
  5. <View style={{ flex: 1, flexDirection: 'row' }}>
  6. <View style={{ flex: 1, width: null, height: 200 }}>
  7. <ImageBackground
  8. style={{ flex: 1, width: null, height: 200 }}
  9. source={{ uri: this.props.thumbnailUrl }}
  10. />
  11. <VideoLength
  12. style={{ position: "absolute", right: 20, top: -35, backgroundColor: "black", color: "white",
  13. borderRadius: 3, paddingHorizontal: 7, textAlign: "right", overflow: "hidden",
  14. }}
  15. videoLength={this.props.videoLength} />
  16. </View>
  17. </View>
  18. );
  19. }
  20. }
  21.  
  22. class VideoLength extends React.Component {
  23. render() {
  24. return (
  25. <View>
  26. <Text style={this.props.style}>{this.props.videoLength}</Text>
  27. </View>
  28. )
  29. }
  30. }
  31.  
  32. class VideoInfo extends React.Component {
  33. render() {
  34. return (
  35. <View style={{ paddingHorizontal: 15, paddingTop: 15, paddingBottom: 15, flexDirection: 'row', marginTop: 5 }}>
  36. <View style={{ marginHorizontal: 10 }}>
  37. <Image
  38. style={{ width: 40, height: 40, borderRadius: 20, margin: 0 }}
  39. source={{ uri: this.props.channelAvatarImage }} />
  40. </View>
  41. <View style={{ paddingHorizontal: 15, paddingBottom: 15 }}>
  42. <Text style={{ fontWeight: '600', fontSize: 18, color: '#fff', flex: 1, flexWrap: 'wrap' }}>
  43. {this.props.videoTitle}
  44. </Text>
  45. <Text style={{ fontSize: 14, marginTop: 6, color: '#4d4d4d' }}>
  46. {
  47. this.props.channelName
  48. } · {
  49. this.props.videoInfo.description.views
  50. } · {
  51. this.props.videoInfo.description.uploadDate
  52. }
  53. </Text>
  54. </View>
  55. <View>
  56. <Icon name='more-vert' size={25} color={'#3e3e3e'} />
  57. </View>
  58. </View>
  59. )
  60. }
  61. }
  62.  
  63. class YouTubeVideo extends React.Component {
  64. render() {
  65. return (
  66. <View>
  67. <VideoThumbnail
  68. thumbnailUrl={this.props.videoInfo.videoThumbnailUrl}
  69. videoLength={this.props.videoInfo.videoLength}
  70. />
  71. <VideoInfo
  72. videoTitle={this.props.videoInfo.title}
  73. videoInfo={this.props.videoInfo}
  74. channelName={this.props.channelInfo.channelName}
  75. channelAvatarImage={this.props.channelInfo.channelAvatarImage} />
  76. </View>
  77. )
  78. }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement