BookmarkPage.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { FlatList, StyleSheet, Text, View } from 'react-native'
  2. import React from 'react'
  3. import NoBookmarkSection from '../components/organisms/Sections/NoBookmarkSection'
  4. import HorizontalNewsCardVariant from '../components/organisms/Cards/HorizontalNewsCardVariant';
  5. import fonts from '../theme/fonts';
  6. import SearchTextInput from '../components/molecules/SearchTextInput';
  7. const BookmarkPage = ({navigation}) => {
  8. const data = ["1", "2", "3", "4", "5"];
  9. //const data = []
  10. const detailPageNavigation = () => {
  11. navigation.navigate("Landing",{'screen':'NewsDetailPage'})
  12. }
  13. return (
  14. <View>
  15. {data.length <= 0 ? <NoBookmarkSection /> :
  16. <View style={styles.container}>
  17. <View >
  18. <SearchTextInput/>
  19. <FlatList
  20. showsVerticalScrollIndicator={false}
  21. ItemSeparatorComponent={() => <View style={{height: fonts.getSize(8)}}></View>}
  22. // ListFooterComponent={() => <View style={{height: fonts.getSize(16)}}></View>}
  23. ListHeaderComponent={() => <View style={{height: fonts.getSize(16)}}></View>}
  24. data={data}
  25. renderItem={(item) => <HorizontalNewsCardVariant onPress={detailPageNavigation}/>}
  26. keyExtractor={item => data.indexOf(item)}
  27. />
  28. </View>
  29. </View>
  30. }
  31. </View>
  32. )
  33. }
  34. export default BookmarkPage
  35. const styles = StyleSheet.create({
  36. container: {
  37. paddingHorizontal: fonts.getSize(16),
  38. }
  39. })