| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- // interface CarBrand {
- // name: string;
- // logo?: any; // This would be the require() statement for the logo image
- // }
- // interface AlphabetSection {
- // letter: string;
- // brands: CarBrand[];
- // }
- // const carBrands: AlphabetSection[] = [
- // {
- // letter: 'A',
- // brands: [
- // { name: 'Audi', logo: require('../../assets/audi.png') },
- // { name: 'Acura', logo: require('../../assets/acura.png') }
- // ]
- // },
- // {
- // letter: 'B',
- // brands: [
- // { name: 'BMW', logo: require('../../assets/bmw1.png') },
- // { name: 'BYD', logo: require('../../assets/byd.png') }
- // ]
- // },
- // {
- // letter: 'C',
- // brands: [
- // { name: 'Chevrolet', logo: require('../../assets/chevrolet1.png') },
- // { name: 'Cadillac', logo: require('../../assets/cadillac1.png') }
- // ]
- // },
- // {
- // letter: 'F',
- // brands: [
- // { name: 'Ford', logo: require('../../assets/ford.png') },
- // { name: 'Fiat', logo: require('../../assets/fiat.png') }
- // ]
- // },
- // {
- // letter: 'G',
- // brands: [{ name: 'Genesis', logo: require('../../assets/genesis.png') }]
- // },
- // {
- // letter: 'H',
- // brands: [
- // { name: 'Honda', logo: require('../../assets/honda.png') },
- // { name: 'Hyundai', logo: require('../../assets/hyundai.png') }
- // ]
- // },
- // {
- // letter: 'J',
- // brands: [{ name: 'Jaguar', logo: require('../../assets/jaguar.png') }]
- // },
- // {
- // letter: 'K',
- // brands: [{ name: 'Kia', logo: require('../../assets/kia.png') }]
- // },
- // {
- // letter: 'M',
- // brands: [
- // { name: 'Mercedes-Benz', logo: require('../../assets/benz.png') },
- // { name: 'Mini', logo: require('../../assets/mini.png') },
- // { name: 'Mazda', logo: require('../../assets/mazda.png') }
- // ]
- // },
- // {
- // letter: 'N',
- // brands: [{ name: 'Nissan', logo: require('../../assets/nissan.png') }]
- // },
- // {
- // letter: 'P',
- // brands: [{ name: 'Porsche', logo: require('../../assets/porsche.png') }]
- // },
- // {
- // letter: 'S',
- // brands: [{ name: 'Subaru', logo: require('../../assets/subaru.png') }]
- // },
- // {
- // letter: 'T',
- // brands: [
- // { name: 'Tesla', logo: require('../../assets/tesla.png') },
- // { name: 'Toyota', logo: require('../../assets/toyota.png') }
- // ]
- // },
- // {
- // letter: 'V',
- // brands: [
- // { name: 'Volkswagen', logo: require('../../assets/volkswagen.png') },
- // { name: 'Volvo', logo: require('../../assets/volvo.png') }
- // ]
- // }
- // ];
- // import React, { useEffect } from 'react';
- // import { View, Text, Image, Pressable, StyleSheet, SafeAreaView, ScrollView } from 'react-native';
- // import useVehicleStore from '../../providers/vehicle_store';
- // import { FlashList } from '@shopify/flash-list';
- // import { router } from 'expo-router';
- // import { PreviousPageBlackSvg } from './SVG';
- // const CarBrandSelector = () => {
- // const { vehicleBrand, vehicleModel, licensePlate, setVehicleBrand, setVehicleModel, setLicensePlate } =
- // useVehicleStore();
- // useEffect(() => {
- // console.log('vehicleBrand in zustand', vehicleBrand);
- // }, [vehicleBrand]);
- // const renderBrandItem = ({ item: brand }: { item: CarBrand }) => (
- // <Pressable
- // style={styles.brandItem}
- // onPress={() => {
- // setVehicleBrand(brand.name);
- // console.log(brand.name);
- // }}
- // >
- // <Image source={brand.logo} style={styles.logo} resizeMode="contain" />
- // <Text style={styles.brandName}>{brand.name}</Text>
- // </Pressable>
- // );
- // const renderAlphabetSection = ({ item: section }: { item: AlphabetSection }) => (
- // <View>
- // <View style={styles.letterHeader} className="h-9">
- // <Text style={styles.letterText}>{section.letter}</Text>
- // </View>
- // <View style={styles.brandRow}>{section.brands.map((brand) => renderBrandItem({ item: brand }))}</View>
- // </View>
- // );
- // return (
- // <SafeAreaView className="flex-1 bg-white" edges={['top', 'right', 'left']}>
- // <ScrollView showsVerticalScrollIndicator={false} className="flex-1 mx-[5%]">
- // <View style={{ marginTop: 25 }}>
- // <Pressable
- // className="self-start"
- // onPress={() => {
- // if (router.canGoBack()) {
- // router.back();
- // } else {
- // router.replace('/accountMainPage');
- // }
- // }}
- // >
- // <PreviousPageBlackSvg />
- // </Pressable>
- // <Text
- // style={{
- // fontSize: 30,
- // marginTop: 25,
- // marginBottom: 10
- // }}
- // >
- // 選擇品牌
- // </Text>
- // </View>
- // <View className="flex-1">
- // <FlashList
- // estimatedItemSize={100}
- // data={carBrands}
- // renderItem={renderAlphabetSection}
- // keyExtractor={(item) => item.letter}
- // />
- // </View>
- // </ScrollView>
- // </SafeAreaView>
- // );
- // };
- // const styles = StyleSheet.create({
- // letterHeader: {
- // backgroundColor: '#E3F2F8',
- // padding: 10,
- // marginVertical: 10
- // },
- // letterText: {
- // color: '#02677D',
- // fontSize: 14,
- // fontWeight: 'bold'
- // },
- // brandRow: {
- // flexDirection: 'row',
- // flexWrap: 'wrap'
- // },
- // brandItem: {
- // width: '33.33%',
- // alignItems: 'center',
- // padding: 10
- // },
- // logo: {
- // width: 80,
- // height: 80
- // },
- // brandName: {
- // marginTop: 5,
- // textAlign: 'center'
- // }
- // });
- // export default CarBrandSelector;
|