SearchPage.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import { StyleSheet, Text, TouchableWithoutFeedback, View, ScrollView} from 'react-native'
  2. import React, { useState } from 'react'
  3. import fonts from '../theme/fonts'
  4. import colors from '../theme/colors'
  5. import { List, TextInput } from 'react-native-paper'
  6. import IonIcon from 'react-native-vector-icons/Ionicons'
  7. import CategoryCard from '../components/organisms/Cards/CategoryCard'
  8. import SearchTextInput from '../components/molecules/SearchTextInput'
  9. const recentSearches = [
  10. "Battlegrounds Mobile India iOS release date",
  11. "Battlegrounds Mobile India iOS release date",
  12. "Battlegrounds Mobile India iOS release date",
  13. "Battlegrounds Mobile India iOS release date",
  14. "Battlegrounds Mobile India iOS release date",
  15. "Battlegrounds Mobile India iOS release date"
  16. ]
  17. const categories = ["Sector Update", "Regional Update", "Politics", "Finance", "Sports", "Regional Update", "Entertainment",'Sexual Wellness']
  18. const SearchPage = () => {
  19. const [isSearching, setSearching] = useState(false)
  20. return (
  21. <View style={styles.searchPageContainer}>
  22. <View style={styles.searchContainer}>
  23. <SearchTextInput/>
  24. </View>
  25. <ScrollView showsVerticalScrollIndicator={false}>
  26. <View style={styles.recentContainer}>
  27. <Text style={styles.sectionTitle}>
  28. Recent Searches
  29. </Text>
  30. <View style={{ gap: 8, paddingVertical: fonts.getSize(8) }}>
  31. {recentSearches.map((item) =>
  32. <TouchableWithoutFeedback onPress={null}>
  33. <View style={{ flexDirection: 'row' }}>
  34. <Text style={{ paddingRight: fonts.getSize(8) }}>#</Text>
  35. <Text style={{ fontFamily: fonts.type.regular, textDecorationLine: 'underline' }}>{item}</Text>
  36. </View>
  37. </TouchableWithoutFeedback>
  38. )}
  39. </View>
  40. <View style={styles.categoriesContainer}>
  41. <Text style={[{}, styles.sectionTitle]}>Browse by Category</Text>
  42. <View style={styles.categoryCardContainer}>
  43. {categories.map((item) => <CategoryCard id={`${item}`} title={item} />)}
  44. </View>
  45. </View>
  46. </View>
  47. </ScrollView>
  48. </View>
  49. )
  50. }
  51. export default SearchPage
  52. const styles = StyleSheet.create({
  53. searchPageContainer: {
  54. paddingHorizontal: fonts.getSize(16)
  55. },
  56. searchContainer: {
  57. paddingVertical: fonts.getSize(8)
  58. },
  59. searchText: {
  60. },
  61. recentContainer: {
  62. paddingHorizontal: fonts.getSize(8),
  63. paddingVertical: fonts.getSize(8)
  64. },
  65. sectionTitle: {
  66. fontFamily: fonts.type.medium,
  67. color: colors.black,
  68. fontSize: fonts.getSize(15)
  69. },
  70. categoriesContainer: {
  71. paddingVertical: fonts.getSize(8),
  72. paddingBottom: fonts.getSize(92)
  73. },
  74. categoryCardContainer: {
  75. flexDirection: 'row',
  76. flexWrap: 'wrap',
  77. gap: 4,
  78. paddingVertical: fonts.getSize(12)
  79. }
  80. })