armadiazrino

Untitled

Jun 22nd, 2022
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. import React from 'react';
  2. import {View, Text, FlatList, Image, TouchableOpacity} from 'react-native';
  3. import style from './style';
  4.  
  5. const ListCard = props => {
  6. const renderItem = ({item}) => (
  7. <TouchableOpacity
  8. onPress={() => props.onPress(item)}
  9. style={style.container}>
  10. <Image
  11. style={style.image}
  12. source={{
  13. uri: item.image,
  14. }}
  15. />
  16. <View style={style.titleContainer}>
  17. <Text style={style.itemTitle}>{item.title}</Text>
  18. <Text numberOfLines={6}>{item.plot}</Text>
  19. </View>
  20. </TouchableOpacity>
  21. );
  22.  
  23. return (
  24. <View>
  25. <Text style={style.title}>{'Your Bookmark'}</Text>
  26. <FlatList
  27. contentContainerStyle={style.flatListContainer}
  28. data={props.data}
  29. renderItem={renderItem}
  30. ListEmptyComponent={
  31. <View style={style.flex}>
  32. <Image
  33. resizeMode={'contain'}
  34. style={style.emptyImage}
  35. source={require('../../assets/oops.png')}
  36. />
  37. <Text style={style.emptyTitle}>
  38. {"you don't have bookmarked movies"}
  39. </Text>
  40. </View>
  41. }
  42. />
  43. </View>
  44. );
  45. };
  46.  
  47. export default ListCard;
  48.  
Advertisement
Add Comment
Please, Sign In to add comment