diff --git a/app/truck-profile/[truckId]/page.tsx b/app/truck-profile/[truckId]/page.tsx index 5c27c55..c9278d8 100644 --- a/app/truck-profile/[truckId]/page.tsx +++ b/app/truck-profile/[truckId]/page.tsx @@ -9,7 +9,9 @@ export default async function TruckProfile({ return ( <> - +
+ +
); } diff --git a/components/food-truck/food-truck-profile.tsx b/components/food-truck/food-truck-profile.tsx index 4c79d3f..b557a3a 100644 --- a/components/food-truck/food-truck-profile.tsx +++ b/components/food-truck/food-truck-profile.tsx @@ -150,19 +150,19 @@ export default function FoodTruckProfile({ truckId }: FoodTruckProfileProps) { }, [sightings]); return ( -
+
{foodTruck && ( -
+
Picture of a food truck -
-
+
+

{foodTruck.name}

@@ -231,12 +231,12 @@ export default function FoodTruckProfile({ truckId }: FoodTruckProfileProps) {
) : ( -
+
Insufficient data to calculate chance
)} -
+
-
+
{reviews.length > 0 ? ( reviews.map((review) => ( diff --git a/components/food-truck/reviews-card.tsx b/components/food-truck/reviews-card.tsx index 5ab73a2..b25c969 100644 --- a/components/food-truck/reviews-card.tsx +++ b/components/food-truck/reviews-card.tsx @@ -36,14 +36,14 @@ export default function ReviewCard({ reviewsData }: ReviewCardProps) {
) : ( -
-
+
+

{reviewsData.content}

Picture of a food truck ); } diff --git a/components/map/map.tsx b/components/map/map.tsx index 050ee67..dd33f9f 100644 --- a/components/map/map.tsx +++ b/components/map/map.tsx @@ -153,8 +153,9 @@ export default function Map() { // -----Effect----- //initial display markers useEffect(() => { - if (!initialSightingLoaded && map && isLoaded) { + if (!initialSightingLoaded && map && isLoaded && filterRef.current) { if (initialSightingId && !isNaN(initialSightingId)) { + console.log(initialSightingId); displayInitSighting( initialSightingId, map, @@ -164,23 +165,24 @@ export default function Map() { ); } if (initialDisplay === "active") { - if (!displaySightingsMarker) { - const displayActiveAtInit = async () => { - const data = await getSightingActiveInLastWeek(); - if (data instanceof PostgrestError) { - console.error(data); - return; - } - makeSightingMarkerUsingSighting( - map as google.maps.Map, - setSighting, - setSelectedSighting, - data - ); - }; - displayActiveAtInit(); - setDisplaySightingsMarker(true); - } + filterRef.current.sightings(); + // if (!displaySightingsMarker) { + // const displayActiveAtInit = async () => { + // const data = await getSightingActiveInLastWeek(); + // if (data instanceof PostgrestError) { + // console.error(data); + // return; + // } + // makeSightingMarkerUsingSighting( + // map as google.maps.Map, + // setSighting, + // setSelectedSighting, + // data + // ); + // }; + // displayActiveAtInit(); + // setDisplaySightingsMarker(true); + // } } setInitialSightingLoaded(true); } diff --git a/components/nav-button-mobile.tsx b/components/nav-button-mobile.tsx index 1354176..526fe56 100644 --- a/components/nav-button-mobile.tsx +++ b/components/nav-button-mobile.tsx @@ -16,18 +16,19 @@ export default function NavButtonMobile({ const pathname = usePathname(); const Icon = NavButton.icon; - + // return differently for map button + const isMap = NavButton.href.toString().includes("/truck-map"); return ( <> - {NavButton.href !== "/truck-map" ? ( + {!isMap ? (