From 2970126b56b660caa0f7552781c09d6a77f865f6 Mon Sep 17 00:00:00 2001 From: Pavlo Tsimura Date: Mon, 30 Oct 2023 23:47:18 +0100 Subject: [PATCH 1/4] Show the "Add stop" button only if 2+ waypoints are filled --- .../DistanceRequest/DistanceRequestFooter.js | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/components/DistanceRequest/DistanceRequestFooter.js b/src/components/DistanceRequest/DistanceRequestFooter.js index e476b2fa6d34..4d4335781b72 100644 --- a/src/components/DistanceRequest/DistanceRequestFooter.js +++ b/src/components/DistanceRequest/DistanceRequestFooter.js @@ -59,6 +59,7 @@ function DistanceRequestFooter({waypoints, transaction, mapboxAccessToken, navig const {translate} = useLocalize(); const numberOfWaypoints = _.size(waypoints); + const numberOfFilledWaypoints = _.size(_.filter(waypoints, (waypoint) => !_.isEmpty(waypoint))); const lastWaypointIndex = numberOfWaypoints - 1; const waypointMarkers = useMemo( @@ -98,16 +99,18 @@ function DistanceRequestFooter({waypoints, transaction, mapboxAccessToken, navig return ( <> - -