|
|
@@ -47,9 +47,15 @@ const NoChargingOngoingPageComponent = () => {
|
|
|
}, []) // Add any missing dependencies here if needed
|
|
|
);
|
|
|
|
|
|
- const StationRow = ({ item }: { item: any }) => {
|
|
|
+ const StationRow = ({ item, index }: { item: any, index: number }) => {
|
|
|
// const imageSource = stationImages[stationID] || require('../../assets/dummyStationPicture.png');
|
|
|
- const imgObj = item.image? {uri: item.image} : require('../../assets/dummyStationPicture.png')
|
|
|
+ console.log('image', item.image, item.stationName);
|
|
|
+ let imgObj = null
|
|
|
+ if (item.image) {
|
|
|
+ imgObj = {uri: item.image}
|
|
|
+ } else {
|
|
|
+ imgObj = require('../../assets/dummyStationPicture.png')
|
|
|
+ }
|
|
|
return (
|
|
|
<Pressable
|
|
|
onPress={() => {
|
|
|
@@ -69,7 +75,7 @@ const NoChargingOngoingPageComponent = () => {
|
|
|
}}
|
|
|
>
|
|
|
<View className="flex flex-1 flex-row w-full ">
|
|
|
- <Image style={styles.image} source={imgObj} />
|
|
|
+ <Image style={styles.image} source={imgObj} key={index} />
|
|
|
<View className="flex flex-col gap-2 mt-5 mr-2">
|
|
|
<Text
|
|
|
style={{
|
|
|
@@ -110,17 +116,17 @@ const NoChargingOngoingPageComponent = () => {
|
|
|
return (
|
|
|
<SafeAreaView edges={['top', 'left', 'right']} className="flex-1 bg-white">
|
|
|
<ScrollView className="flex-1 mt-8 " nestedScrollEnabled={true} showsVerticalScrollIndicator={false}>
|
|
|
- <View className="">
|
|
|
- <View className="">
|
|
|
+ <View>
|
|
|
+ <View>
|
|
|
<Text className="text-5xl pt-1 pb-6 mx-[5%]">暫無正在進行的充電</Text>
|
|
|
<View>
|
|
|
<Text className="text-lg mx-[5%] mb-6">立刻前往Crazy Charge 充電站充電吧!</Text>
|
|
|
|
|
|
- <View className="">
|
|
|
+ <View>
|
|
|
{newAvailableConnectors?.map((item, index) => (
|
|
|
<View key={index}>
|
|
|
<View className="border-b border-gray-200" />
|
|
|
- <StationRow item={item} key={index} />
|
|
|
+ <StationRow item={item} key={index}/>
|
|
|
</View>
|
|
|
))}
|
|
|
</View>
|