setVehiclePageComponent.tsx 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import { router } from 'expo-router';
  2. import { View, Text, ScrollView, Pressable, Image, Dimensions, StyleSheet, TextInput, FlatList } from 'react-native';
  3. import { SafeAreaView } from 'react-native-safe-area-context';
  4. import { PreviousPageBlackSvg } from '../global/SVG';
  5. import NormalButton from '../global/normal_button';
  6. import { useState } from 'react';
  7. import Checkbox from 'expo-checkbox';
  8. import useVehicleStore from '../../providers/vehicle_store';
  9. import CarBrandSelector from './testingCar';
  10. const SetVehiclePageComponent = () => {
  11. const [isChecked, setChecked] = useState(false);
  12. const { vehicleBrand, vehicleModel, licensePlate, setVehicleBrand, setVehicleModel, setLicensePlate } =
  13. useVehicleStore();
  14. return (
  15. <SafeAreaView className="flex-1 bg-white" edges={['top', 'right', 'left']}>
  16. <ScrollView showsVerticalScrollIndicator={false} className="flex-1 mx-[5%]">
  17. <View style={{ marginTop: 25 }}>
  18. <Pressable
  19. className="self-start"
  20. onPress={() => {
  21. if (router.canGoBack()) {
  22. router.back();
  23. } else {
  24. router.replace('/accountMainPage');
  25. }
  26. }}
  27. >
  28. <PreviousPageBlackSvg />
  29. </Pressable>
  30. <Text
  31. style={{
  32. fontSize: 30,
  33. marginTop: 25,
  34. marginBottom: 10
  35. }}
  36. >
  37. 選擇品牌
  38. </Text>
  39. </View>
  40. <View className="flex-1">
  41. <CarBrandSelector />
  42. </View>
  43. </ScrollView>
  44. </SafeAreaView>
  45. );
  46. };
  47. const styles = StyleSheet.create({
  48. button: { flex: 1, gap: 10, marginTop: 5 },
  49. fakeTextInput: {
  50. maxWidth: '100%',
  51. fontSize: 16,
  52. borderWidth: 1,
  53. padding: 20,
  54. borderRadius: 12,
  55. borderColor: '#bbbbbb'
  56. },
  57. checkbox: {
  58. margin: 8
  59. }
  60. });
  61. export default SetVehiclePageComponent;