From 7a7df793a77a230f6705cc84cce5e1837ff38731 Mon Sep 17 00:00:00 2001 From: Gurpreet Singh <91670399+gsinghg19@users.noreply.github.com> Date: Tue, 16 May 2023 14:56:46 +0100 Subject: [PATCH] feat: map feature now builds app on the selected location given. --- components/Map.js | 14 +++++++++----- slices/navSlice.js | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/components/Map.js b/components/Map.js index 6317635..73fb036 100644 --- a/components/Map.js +++ b/components/Map.js @@ -1,19 +1,23 @@ import React from "react"; import MapView from "react-native-maps"; +import { useSelector } from "react-redux"; import tw from "twrnc"; +import { selectOrigin } from "../slices/navSlice"; const Map = () => { + const origin = useSelector(selectOrigin); + return ( + > ); }; diff --git a/slices/navSlice.js b/slices/navSlice.js index f89d2f4..f97a7dc 100644 --- a/slices/navSlice.js +++ b/slices/navSlice.js @@ -14,10 +14,10 @@ export const navSlice = createSlice({ state.origin = action.payload; }, setDestination: (state, action) => { - state.origin = action.payload; + state.destination = action.payload; }, setTravelTimeInformation: (state, action) => { - state.origin = action.payload; + state.travelTimeInformation = action.payload; }, }, });