From 1d79801e59045e9cdffbb8776d2808117027e67c Mon Sep 17 00:00:00 2001 From: Inga Date: Fri, 17 Nov 2023 03:03:43 +0000 Subject: [PATCH] isFirst / isLast --- src/routePlanner/marker.tsx | 6 +++--- src/routePlanner/markers.tsx | 9 +++++++-- src/routePlanner/types.ts | 6 ++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/routePlanner/marker.tsx b/src/routePlanner/marker.tsx index fb09b0b..237b2e5 100644 --- a/src/routePlanner/marker.tsx +++ b/src/routePlanner/marker.tsx @@ -1,14 +1,14 @@ import { MarkerProps } from './types'; -export const MarkerComponent = ({ marker }: MarkerProps) => { +export const MarkerComponent = ({ marker, isFirst, isLast }: MarkerProps) => { return (
  • {`Waypoint ${marker.label} (${marker.key.substring(0, 4)})`} - - diff --git a/src/routePlanner/markers.tsx b/src/routePlanner/markers.tsx index 31d64d1..7c05b04 100644 --- a/src/routePlanner/markers.tsx +++ b/src/routePlanner/markers.tsx @@ -37,8 +37,13 @@ export const MarkersComponent = ({ <>

    Markers

      - {markers.map((marker) => ( - + {markers.map((marker, i) => ( + ))}
    diff --git a/src/routePlanner/types.ts b/src/routePlanner/types.ts index 58c3e7a..678b4ef 100644 --- a/src/routePlanner/types.ts +++ b/src/routePlanner/types.ts @@ -3,8 +3,8 @@ import { Coordinates, Waypoint } from '../shared/types'; export type Marker = Waypoint & { key: string; remove: () => void; - moveUp?: () => void; - moveDown?: () => void; + moveUp: () => void; + moveDown: () => void; label: string; }; @@ -49,4 +49,6 @@ export type ExportProps = { export type MarkerProps = { marker: Marker; + isFirst: boolean; + isLast: boolean; };