From d9327e0068537ffab0d8e468ce0ec171666c9f38 Mon Sep 17 00:00:00 2001 From: pir8bay Date: Sat, 6 Jul 2024 13:29:03 +0300 Subject: [PATCH] fixed improper route id in route options --- src/components/RouteCard.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/RouteCard.tsx b/src/components/RouteCard.tsx index 2ac9b951..4adcac21 100644 --- a/src/components/RouteCard.tsx +++ b/src/components/RouteCard.tsx @@ -13,13 +13,10 @@ import type { Route, RouteSegments } from '~/types' import { reverseGeocode } from '~/map' -type RouteOptionsProps = { - route?: Route; -} - const [showRouteOptionsCard, setShowRouteOptionsCard] = createSignal(false) +const [currentCardRoute, setCurrentCardRoute] = createSignal(undefined) -const RouteOptionsCard: Component = (props) => { +const RouteOptionsCard: Component = () => { const [isMdOrLarger, setIsMdOrLarger] = createSignal(false) // listen isMdOrLarger @@ -49,7 +46,7 @@ const RouteOptionsCard: Component = (props) => { 'transform translate-y-full': !isMdOrLarger() && !showRouteOptionsCard(), }}>
event.stopPropagation()}> - +
@@ -89,6 +86,7 @@ const RouteHeader = (props: { route?: RouteSegments }) => { const handleMoreOptionsClick = (event: MouseEvent) => { event.stopPropagation() setShowRouteOptionsCard(true) + setCurrentCardRoute(props.route) } return ( @@ -221,7 +219,7 @@ const RouteCard: Component = (props) => { return (
- +
}