|
|
@@ -22,15 +22,17 @@ import { PROVIDER_GOOGLE } from 'react-native-maps';
|
|
|
import { calculateDistance } from '../global/distanceCalculator';
|
|
|
|
|
|
interface TabItem {
|
|
|
- imgURL: ImageSourcePropType;
|
|
|
+ imgURL?: ImageSourcePropType | undefined;
|
|
|
date: string;
|
|
|
time: string;
|
|
|
chargeStationName: string;
|
|
|
chargeStationAddress: string;
|
|
|
distance: string;
|
|
|
- stationID: string;
|
|
|
- lat: number;
|
|
|
- lng: number;
|
|
|
+ stationID?: string;
|
|
|
+ longitude?: number;
|
|
|
+ latitude?: number;
|
|
|
+ lat?: number;
|
|
|
+ lng?: number;
|
|
|
}
|
|
|
|
|
|
const dummyTabItems: TabItem[] = [
|
|
|
@@ -182,10 +184,7 @@ const SearchResultComponent = () => {
|
|
|
lat: station.StationLat,
|
|
|
date: '今天',
|
|
|
stationID: station.StationID,
|
|
|
-
|
|
|
- // imgURL: stationImages[station.StationID] || require('../../assets/dummyStationPicture.png'),
|
|
|
imgURL: station.image
|
|
|
- // distance: distance !== null ? formatDistance(distance) : 'N/A'
|
|
|
};
|
|
|
})
|
|
|
);
|
|
|
@@ -333,7 +332,7 @@ const SearchResultComponent = () => {
|
|
|
router.push({
|
|
|
pathname: '/resultDetailPage',
|
|
|
params: {
|
|
|
- imageSource: item.imgURL,
|
|
|
+ imageSource: item.imgURL as string,
|
|
|
chargeStationAddress: item.chargeStationAddress,
|
|
|
chargeStationID: item.stationID,
|
|
|
chargeStationName: item.chargeStationName,
|
|
|
@@ -350,7 +349,7 @@ const SearchResultComponent = () => {
|
|
|
]}
|
|
|
>
|
|
|
<View style={styles.rowContainer}>
|
|
|
- <Image style={styles.image} source={{ uri: item.imgURL }} />
|
|
|
+ <Image style={styles.image} source={{ uri: item.imgURL } as ImageSourcePropType} />
|
|
|
<View style={styles.textContainer}>
|
|
|
<Text
|
|
|
style={{
|