homePage.tsx 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import { View, Text, ScrollView, FlatList } from 'react-native';
  2. import NormalButton from '../global/normal_button';
  3. import NormalInput from '../global/normal_input';
  4. import { SafeAreaView } from 'react-native-safe-area-context';
  5. import { router } from 'expo-router';
  6. import RecentlyBookedScrollView from '../global/recentlyBookedScrollView';
  7. import { BellIconSvg, HomeIconSvg } from '../global/SVG';
  8. interface HomePageProps {}
  9. const HomePage: React.FC<HomePageProps> = () => {
  10. return (
  11. <SafeAreaView
  12. edges={['top', 'left', 'right']}
  13. className="flex-1 bg-white"
  14. >
  15. <ScrollView
  16. showsVerticalScrollIndicator={false}
  17. className="flex-1 mx-[5%] mt-8 "
  18. >
  19. <View className="">
  20. <View className="flex-row items-center pb-4">
  21. <HomeIconSvg />
  22. <View className="pl-2 flex-1 flex-column ">
  23. <View className="flex-row justify-between">
  24. <Text className="text-lg pb-1">你好!</Text>
  25. <BellIconSvg />
  26. </View>
  27. <Text className="text-4xl font-light ">
  28. Mike Chan
  29. </Text>
  30. </View>
  31. </View>
  32. <NormalInput
  33. placeholder="搜尋充電站或地區"
  34. onChangeText={() => console.log('abc')}
  35. />
  36. </View>
  37. {/* ************************近期預約過************************ */}
  38. <RecentlyBookedScrollView />
  39. {/* ************************Bottom Button Groups************************ */}
  40. <View className="">
  41. <View className=" mb-4">
  42. <NormalButton
  43. onPress={() => console.log('掃瞄及充電')}
  44. title={
  45. <Text className="text-white font-bold text-lg">
  46. 掃瞄及充電
  47. </Text>
  48. }
  49. extendedStyle={{
  50. alignItems: 'flex-start',
  51. padding: 24
  52. }}
  53. />
  54. </View>
  55. <View className="flex-1 flex-row justify-between gap-6">
  56. <View className="flex-1">
  57. <NormalButton
  58. onPress={() =>
  59. // router.push('/(charging)')
  60. // router.push('/ReservationLocation')
  61. router.push(
  62. 'bookingMenuPage'
  63. )
  64. }
  65. title={
  66. <Text className="text-white font-bold text-lg">
  67. 我的預約
  68. </Text>
  69. }
  70. extendedStyle={{
  71. alignItems: 'flex-start',
  72. padding: 24
  73. }}
  74. />
  75. </View>
  76. <View className="flex-1">
  77. <NormalButton
  78. onPress={() => router.push('/k')}
  79. title={
  80. <Text className="text-white font-bold text-lg">
  81. 我的車輛
  82. </Text>
  83. }
  84. extendedStyle={{
  85. alignItems: 'flex-start',
  86. padding: 24
  87. }}
  88. />
  89. </View>
  90. </View>
  91. </View>
  92. </ScrollView>
  93. </SafeAreaView>
  94. );
  95. };
  96. export default HomePage;