manageVehiclePageComponent.tsx 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. import { router } from 'expo-router';
  2. import {
  3. View,
  4. Text,
  5. ScrollView,
  6. Pressable,
  7. Image,
  8. Dimensions
  9. } from 'react-native';
  10. import { SafeAreaView } from 'react-native-safe-area-context';
  11. import { PreviousPageBlackSvg, StarSvg } from '../global/SVG';
  12. import NormalButton from '../global/normal_button';
  13. const ManageVehiclePageComponent = () => {
  14. const { height: deviceHeight, width: deviceWidth } =
  15. Dimensions.get('window');
  16. return (
  17. <SafeAreaView
  18. className="flex-1 bg-white"
  19. edges={['top', 'right', 'left']}
  20. >
  21. <ScrollView
  22. showsVerticalScrollIndicator={false}
  23. className="flex-1 mx-[5%]"
  24. >
  25. <View style={{ marginTop: 25, flexDirection: 'column' }}>
  26. <Pressable
  27. className="self-start"
  28. onPress={() => {
  29. if (router.canGoBack()) {
  30. router.back();
  31. } else {
  32. router.replace('/accountMainPage');
  33. }
  34. }}
  35. >
  36. <PreviousPageBlackSvg />
  37. </Pressable>
  38. </View>
  39. <Text
  40. style={{
  41. fontSize: 30,
  42. marginTop: 25,
  43. marginBottom: 10
  44. }}
  45. >
  46. 管理車輛
  47. </Text>
  48. <View className="items-center ">
  49. <Image
  50. source={require('../../assets/car.png')}
  51. resizeMode="contain"
  52. style={{
  53. width: deviceWidth * 0.8,
  54. height: deviceHeight * 0.25
  55. }}
  56. />
  57. </View>
  58. <View className="flex-row space-x-2 ">
  59. <View
  60. style={{
  61. width: 4,
  62. height: '100%',
  63. backgroundColor: '#02677D'
  64. }}
  65. />
  66. <View>
  67. <Text className="text-2xl">TESLA Model 3</Text>
  68. <Text className="text-lg text-[#888888]">CE1107</Text>
  69. </View>
  70. </View>
  71. <NormalButton
  72. title={
  73. <Text
  74. style={{
  75. fontWeight: '500',
  76. fontSize: 20,
  77. color: '#fff'
  78. }}
  79. >
  80. 設置為預設車輛 <StarSvg />
  81. </Text>
  82. }
  83. onPress={() => console.log('設置為預設車輛')}
  84. extendedStyle={{ marginTop: 24 }}
  85. />
  86. <View className="w-full h-1 my-4 bg-[#DBE4E8]" />
  87. <View>
  88. <Text className="text-xl pb-4">車輛資訊</Text>
  89. <Text className="text-base text-[#888888]">加入日期</Text>
  90. <Text className="text-base mb-3">2/24/2024</Text>
  91. <Text className="text-base text-[#888888]">總充電量</Text>
  92. <Text className="text-base mb-3">307kWh</Text>
  93. <Text className="text-base text-[#888888]">上一次充電</Text>
  94. <Text className="text-base mb-3">3/12/2024</Text>
  95. <View className="my-4 pb-8">
  96. <NormalButton
  97. title={
  98. <Text
  99. style={{
  100. color: 'white',
  101. fontSize: 20,
  102. fontWeight: '800'
  103. }}
  104. >
  105. 删除車輛
  106. </Text>
  107. }
  108. onPress={() => console.log('删除車輛')}
  109. extendedStyle={{
  110. backgroundColor: '#D40000'
  111. }}
  112. />
  113. </View>
  114. </View>
  115. </ScrollView>
  116. </SafeAreaView>
  117. );
  118. };
  119. export default ManageVehiclePageComponent;