From 1accf428f8df34ce974f6d14f94d0bcfca2e73ff Mon Sep 17 00:00:00 2001 From: cabbage Date: Mon, 24 Mar 2025 17:36:19 +0900 Subject: [PATCH 1/5] cleanup: comment out all console log --- components/map/map.tsx | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) 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); } From ea744d2cbea00fb697365bf2f726f87a6848582b Mon Sep 17 00:00:00 2001 From: cabbage Date: Sun, 20 Apr 2025 12:36:44 +0900 Subject: [PATCH 2/5] fix: desktop food truck profile --- app/truck-profile/[truckId]/page.tsx | 4 ++- components/food-truck/food-truck-profile.tsx | 26 ++++++++++---------- components/food-truck/reviews-card.tsx | 6 ++--- 3 files changed, 19 insertions(+), 17 deletions(-) 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 Date: Sun, 20 Apr 2025 17:06:08 +0900 Subject: [PATCH 3/5] fix: add top nav bar on desktop --- components/header.tsx | 2 +- components/logout-button.tsx | 2 +- components/nav-button-mobile.tsx | 17 +++++++++++------ components/sidebar-mobile.tsx | 6 ++++-- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/components/header.tsx b/components/header.tsx index e9f7294..9855736 100644 --- a/components/header.tsx +++ b/components/header.tsx @@ -32,7 +32,7 @@ export default function Header({ user }: HeaderProps) { return ( <> ); } diff --git a/components/nav-button-mobile.tsx b/components/nav-button-mobile.tsx index 77eab0d..3b62009 100644 --- a/components/nav-button-mobile.tsx +++ b/components/nav-button-mobile.tsx @@ -24,11 +24,11 @@ export default function NavButtonMobile({
{/* creates a button for each button passed to the component */} From fb711b9f3cb7bff95f28f8c21b92deea90c8cb05 Mon Sep 17 00:00:00 2001 From: cabbage Date: Mon, 21 Apr 2025 00:49:42 +0900 Subject: [PATCH 5/5] fix: stylize nav bar desktop, change style --- components/logout-button.tsx | 8 +++++--- components/nav-button-mobile.tsx | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/logout-button.tsx b/components/logout-button.tsx index fc13259..f1f73fb 100644 --- a/components/logout-button.tsx +++ b/components/logout-button.tsx @@ -13,10 +13,12 @@ export default function LogoutButton({ handleToggle }: LogoutButtonProps) { signOutAction(); handleToggle(); }} - className="flex font-semibold items-center w-48 h-12 p-3 mt-3 last:mb-4, md:last:mb-0 md:ring-1 md:ring-primary md:rounded-t-xl md:justify-center" + className="flex font-semibold items-center w-48 h-12 p-3 mt-3 last:mb-4, md:last:mb-0 md:mt-0" > - -

Logout

+
+ +

Logout

+
); } diff --git a/components/nav-button-mobile.tsx b/components/nav-button-mobile.tsx index 3b62009..526fe56 100644 --- a/components/nav-button-mobile.tsx +++ b/components/nav-button-mobile.tsx @@ -28,7 +28,7 @@ export default function NavButtonMobile({ >