accountMainPageComponent.tsx 4.5 KB

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