notificationPage.tsx 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import {
  2. View,
  3. Text,
  4. Pressable,
  5. Image,
  6. ScrollView,
  7. Alert,
  8. ImageBackground,
  9. ActivityIndicator,
  10. Dimensions
  11. } from 'react-native';
  12. import { SafeAreaView } from 'react-native-safe-area-context';
  13. import { router, useLocalSearchParams } from 'expo-router';
  14. import { CrossLogoSvg, PreviousPageBlackSvg } from '../../../../component/global/SVG';
  15. import { useEffect, useState } from 'react';
  16. import NotificationTabView from '../../../../component/global/notificationTabViewComponent';
  17. const NotificationPageComponent = () => {
  18. const params = useLocalSearchParams();
  19. const screenHeight = Dimensions.get('window').height;
  20. const [loading, setLoading] = useState(false);
  21. const [loading1, setLoading1] = useState(false);
  22. const { reservationAfter2025, passingThisPromotionToBell } = useLocalSearchParams();
  23. const parsedReservationAfter2025 = JSON.parse(reservationAfter2025 as string);
  24. const parsedPassingThisPromotionToBell = JSON.parse(passingThisPromotionToBell as string);
  25. return (
  26. <SafeAreaView className="flex-1 bg-white" edges={['top', 'right', 'left']}>
  27. <View style={{ minHeight: screenHeight, flex: 1 }} className="mx-[5%]">
  28. <View style={{ marginTop: 25 }}>
  29. <Pressable
  30. onPress={() => {
  31. if (router.canGoBack()) {
  32. router.back();
  33. } else {
  34. router.replace('/optionPage');
  35. }
  36. }}
  37. hitSlop={{ top: 20, bottom: 20, left: 20, right: 20 }}
  38. >
  39. <CrossLogoSvg />
  40. </Pressable>
  41. <Text style={{ fontSize: 45, marginVertical: 25 }}>通知</Text>
  42. </View>
  43. <View className="flex-1">
  44. <NotificationTabView
  45. titles={['充電資訊', '活動優惠']}
  46. reservationAfter2025={parsedReservationAfter2025}
  47. passingThisPromotionToBell={parsedPassingThisPromotionToBell}
  48. />
  49. </View>
  50. </View>
  51. </SafeAreaView>
  52. );
  53. };
  54. export default NotificationPageComponent;