From 1cf24f4a0f6df444098d799b5f525c32a8f6af54 Mon Sep 17 00:00:00 2001 From: ray Date: Fri, 15 Mar 2024 15:53:37 -0700 Subject: [PATCH] DBC22-1879: added button to switch from and to input --- src/frontend/src/Components/map/LocationSearch.js | 2 +- src/frontend/src/Components/map/RouteSearch.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/Components/map/LocationSearch.js b/src/frontend/src/Components/map/LocationSearch.js index 5c7e1afdb..533957c22 100644 --- a/src/frontend/src/Components/map/LocationSearch.js +++ b/src/frontend/src/Components/map/LocationSearch.js @@ -46,7 +46,7 @@ export default function LocationSearch(props) { true} id="location-search-typeahead" isLoading={isSearching} diff --git a/src/frontend/src/Components/map/RouteSearch.js b/src/frontend/src/Components/map/RouteSearch.js index 1ce12e644..ed2700a43 100644 --- a/src/frontend/src/Components/map/RouteSearch.js +++ b/src/frontend/src/Components/map/RouteSearch.js @@ -14,6 +14,7 @@ import { faCircleDot, faLocationDot } from '@fortawesome/free-solid-svg-icons'; +import Button from 'react-bootstrap/Button'; import Spinner from 'react-bootstrap/Spinner'; // Styling @@ -70,6 +71,12 @@ export default function RouteSearch(props) { } }, [showSpinner]); + // Handlers + const swapHandler = () => { + dispatch(updateSearchLocationFrom(searchLocationTo)); + dispatch(updateSearchLocationTo(searchLocationFrom)); + } + // Rendering return (
@@ -96,6 +103,10 @@ export default function RouteSearch(props) { }
} + + {!!searchLocationFrom.length && !!searchLocationTo.length && + + } ); }