bookingMenuPage.tsx 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import { View, Text, StyleSheet, Image, ScrollView } from 'react-native';
  2. import TabViewComponent, { TabItem } from '../global/tabView';
  3. import NormalButton from '../global/normal_button';
  4. import { SafeAreaView } from 'react-native-safe-area-context';
  5. import RecentlyBookedScrollView from '../global/recentlyBookedScrollView';
  6. import { router } from 'expo-router';
  7. interface BookingMenuPageProps {}
  8. const dummyTabItems: TabItem[] = [
  9. {
  10. imgURL: require('../../assets/dummyStationPicture.png'),
  11. date: '今天',
  12. time: '16:30',
  13. chargeStationName: '上環街市充電站',
  14. chargeStationAddress: '香港上環皇后大道中345號',
  15. distance: '400米'
  16. },
  17. {
  18. imgURL: require('../../assets/dummyStationPicture2.png'),
  19. date: '3月15',
  20. time: '17:45',
  21. chargeStationName: '中環IFC充電站',
  22. chargeStationAddress: '香港中環皇后大道中999號',
  23. distance: '680米'
  24. },
  25. {
  26. imgURL: require('../../assets/dummyStationPicture2.png'),
  27. date: '4月20',
  28. time: '12:30',
  29. chargeStationName: '中環IFC充電站',
  30. chargeStationAddress: '香港中環皇后大道中999號',
  31. distance: '680米'
  32. }
  33. ];
  34. const BookingMenuPageComponent: React.FC<BookingMenuPageProps> = () => {
  35. return (
  36. <SafeAreaView
  37. edges={['top', 'left', 'right']}
  38. className="flex-1 bg-white"
  39. >
  40. <View className="flex-1 mt-8 ">
  41. <View className="h-[55%] mx-[5%]">
  42. <View className="justify-center">
  43. <Text className="text-5xl pt-1 pb-6">預約</Text>
  44. <NormalButton
  45. title={
  46. <Text
  47. style={{
  48. color: 'white',
  49. fontSize: 16,
  50. fontWeight: '800'
  51. }}
  52. >
  53. + 新增預約
  54. </Text>
  55. }
  56. onPress={() =>
  57. router.push('reservationLocationPage')
  58. }
  59. extendedStyle={{ padding: 28 }}
  60. />
  61. </View>
  62. <View className='min-h-[200px]'>
  63. <RecentlyBookedScrollView />
  64. </View>
  65. </View>
  66. <View className="h-[45%]">
  67. <TabViewComponent
  68. titles={['已預約', '已完成']}
  69. tabItems={dummyTabItems}
  70. />
  71. </View>
  72. </View>
  73. </SafeAreaView>
  74. );
  75. };
  76. const styles = StyleSheet.create({
  77. recentBookingRowContainer: {
  78. flexDirection: 'row',
  79. alignItems: 'center'
  80. }
  81. });
  82. export default BookingMenuPageComponent;