notificationPage.tsx 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import { View, Text, Pressable, Image, ScrollView, Alert, ImageBackground, ActivityIndicator } from 'react-native';
  2. import { SafeAreaView } from 'react-native-safe-area-context';
  3. import { router, useLocalSearchParams } from 'expo-router';
  4. import { PreviousPageBlackSvg } from '../../../../component/global/SVG';
  5. import { useEffect, useState } from 'react';
  6. import { FlashList } from '@shopify/flash-list';
  7. interface TransactionRecordItem {
  8. date: string;
  9. title: string;
  10. description: string;
  11. }
  12. const TransactionRow: React.FC<TransactionRecordItem> = ({ date, description, amount, actual_total_power }) => (
  13. <View className="flex flex-row w-full py-4 border-b border-[#CCCCCC]">
  14. <Text className="flex-[0.25] text-sm">{date}</Text>
  15. <Text className="flex-[0.25] text-sm">{description}</Text>
  16. <Text className="flex-[0.25] text-sm text-right">
  17. {actual_total_power !== '-' ? Number(actual_total_power).toFixed(1) : actual_total_power}
  18. </Text>
  19. <Text className="flex-[0.25] text-sm text-right">${Number.isInteger(amount) ? amount : amount.toFixed(1)}</Text>
  20. </View>
  21. );
  22. const NotificationPageComponent = () => {
  23. const params = useLocalSearchParams();
  24. const [loading, setLoading] = useState(false);
  25. const [loading1, setLoading1] = useState(false);
  26. return (
  27. <SafeAreaView className="flex-1 bg-white" edges={['top', 'right', 'left']}>
  28. <ScrollView style={{ flex: 1 }} className="mx-[5%]" showsVerticalScrollIndicator={false}>
  29. <View style={{ marginTop: 25 }}>
  30. <Pressable
  31. onPress={() => {
  32. if (router.canGoBack()) {
  33. router.back();
  34. } else {
  35. router.replace('/accountMainPage');
  36. }
  37. }}
  38. >
  39. <PreviousPageBlackSvg />
  40. </Pressable>
  41. <Text style={{ fontSize: 45, marginVertical: 25 }}>最新消息</Text>
  42. </View>
  43. <View className="flex flex-row w-full py-2 border-b border-[#CCCCCC]">
  44. <Text className="flex-[0.25] text-sm text-[#888888]">日期</Text>
  45. <Text className="flex-[0.25] text-sm text-[#888888]">標題</Text>
  46. <Text className="flex-[0.25] text-sm text-right text-[#888888]"></Text>
  47. </View>
  48. <View className="border-t border-[#CCCCCC]" />
  49. </ScrollView>
  50. </SafeAreaView>
  51. );
  52. };
  53. export default NotificationPageComponent;