accountMainPageComponent.tsx 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. import { View, Text, ScrollView, Image, Pressable, Dimensions } from 'react-native';
  2. import { SafeAreaView } from 'react-native-safe-area-context';
  3. import { router } from 'expo-router';
  4. import { useAuth } from '../../context/AuthProvider';
  5. import {
  6. AccountSettingIconSvg,
  7. ActivitySvg,
  8. MyCarSvg,
  9. QuestionMarkIconSvg,
  10. SettingIconSvg,
  11. VipCodeIcoonSvg,
  12. WalletSvg
  13. } from '../global/SVG';
  14. const AccountMainPageComponent = () => {
  15. const { user, logout } = useAuth();
  16. const screenWidth = Dimensions.get('window').width;
  17. const imageWidth = screenWidth * 0.9; // 90% of screen width
  18. const aspectRatio = 210 / 375;
  19. return (
  20. <SafeAreaView className="flex-1 bg-white" edges={['top', 'left', 'right']}>
  21. <ScrollView className="flex-1 mx-[5%]" showsVerticalScrollIndicator={false}>
  22. <View style={{ marginTop: 25 }}>
  23. <Text style={{ fontSize: 48 }}>{user?.nickname}</Text>
  24. </View>
  25. <View className="flex-row space-x-4 mt-4">
  26. <Pressable
  27. className="h-[114px] w-[30%] bg-[#e7f2f8] items-center justify-center rounded-xl"
  28. onPress={() => router.push('/(account)/(wallet)/walletPage')}
  29. >
  30. <WalletSvg />
  31. <Text>錢包</Text>
  32. </Pressable>
  33. {/* <Pressable
  34. className="h-[114px] w-[30%] bg-[#e7f2f8] items-center justify-center rounded-xl"
  35. onPress={() => router.replace('myVehiclePage')}
  36. >
  37. <MyCarSvg />
  38. <Text>我的車輛</Text>
  39. </Pressable> */}
  40. <Pressable
  41. className="h-[114px] w-[30%] bg-[#e7f2f8] items-center justify-center rounded-xl"
  42. onPress={() => router.replace('vipQrPage')}
  43. >
  44. <VipCodeIcoonSvg />
  45. <Text>VIP Code</Text>
  46. </Pressable>
  47. <Pressable
  48. className="h-[114px] w-[30%] bg-[#e7f2f8] items-center justify-center rounded-xl"
  49. onPress={() => router.push('/activityRecordPage')}
  50. >
  51. <ActivitySvg />
  52. <Text>活動記錄</Text>
  53. </Pressable>
  54. </View>
  55. <View className="my-4 ">
  56. <Pressable onPress={() => router.push('uberVerificationPage')}>
  57. <Image
  58. resizeMode="contain"
  59. source={require('../../assets/uber208.png')}
  60. style={{ width: imageWidth, height: imageWidth * aspectRatio, alignSelf: 'center' }}
  61. />
  62. </Pressable>
  63. </View>
  64. <View className="w-full h-1 bg-[#DBE4E8]" />
  65. <View>
  66. <View className="py-4">
  67. <Pressable
  68. onPress={() => router.push('/accountSettingPage')}
  69. className="flex-row items-center"
  70. hitSlop={{
  71. top: 10,
  72. bottom: 10,
  73. left: 10,
  74. right: 10
  75. }}
  76. >
  77. <AccountSettingIconSvg />
  78. <Text className="text-lg pl-2">帳戶管理</Text>
  79. </Pressable>
  80. </View>
  81. <View className="h-0.5 bg-[#f4f4f4]" />
  82. <View className=" py-4 ">
  83. <Pressable
  84. onPress={() => router.push('/assistancePage')}
  85. className="flex-row items-center"
  86. hitSlop={{
  87. top: 10,
  88. bottom: 10,
  89. left: 10,
  90. right: 10
  91. }}
  92. >
  93. <QuestionMarkIconSvg />
  94. <Text className="text-lg pl-2">排除解難</Text>
  95. </Pressable>
  96. </View>
  97. <View className="h-0.5 bg-[#f4f4f4]" />
  98. <View className="py-4">
  99. <Pressable
  100. onPress={logout}
  101. className="flex-row items-center"
  102. hitSlop={{
  103. top: 10,
  104. bottom: 10,
  105. left: 10,
  106. right: 10
  107. }}
  108. >
  109. <SettingIconSvg />
  110. <Text className="text-lg pl-2">登出</Text>
  111. </Pressable>
  112. </View>
  113. <View className="h-0.5 bg-[#f4f4f4]" />
  114. </View>
  115. </ScrollView>
  116. </SafeAreaView>
  117. );
  118. };
  119. export default AccountMainPageComponent;