- {stations.map(({ id, stationName, railZone }) => (
-
- {stationName} is{' '}
- {railZone ? (
- <>
- in Zone {railZone}
- >
- ) : (
- Out of County
+ {stations.length > 0 && (
+ <>
+
+ {stations.map(({ id, stationName, railZone }, i) => (
+
+ {stationName} is{' '}
+ {railZone < 6 && (
+ <>
+ in Zone {railZone}
+ >
+ )}
+ {railZone === 6 && (
+ <>
+ in nTrain Zone 5
+ >
+ )}
+ {railZone === 7 && Out of County}.
+
+ ))}
+
+ {stations.length > 1 && ticketMode && (
+
+
= 2 ? '' : 'wmnds-m-b-none'}>
+ To travel between these stations, you’ll need a{' '}
+ zone 1 to {maxZone > 5 ? 5 : maxZone} ticket.
+
+ {minZone >= 2 && (
+
+ If you do not need to travel through Birmingham City Centre, you can get a{' '}
+ zone 2 to 5 ticket.
+
+ )}
+
)}
- .
-
- ))}
+ >
+ )}
{fullAccessStations.length > 0 && (
diff --git a/src/components/shared/Result/Result.module.scss b/src/components/shared/Result/Result.module.scss
index fd433c5..a551666 100644
--- a/src/components/shared/Result/Result.module.scss
+++ b/src/components/shared/Result/Result.module.scss
@@ -10,3 +10,7 @@
align-items: flex-start;
flex-wrap: nowrap;
}
+
+.bgSecondary {
+ background-color: get-color(secondary, 70);
+}
diff --git a/src/globalState/AutoCompleteContext.js b/src/globalState/AutoCompleteContext.js
index fd69da9..c4923f8 100644
--- a/src/globalState/AutoCompleteContext.js
+++ b/src/globalState/AutoCompleteContext.js
@@ -25,6 +25,7 @@ export const AutoCompleteProvider = (props) => {
// Set intial state
const initialState = {
+ ticketMode: getSearchParam('ticketSearch') === 'true',
queries: [getSearchParam('query0') || '', getSearchParam('query1') || '', ...additionalQueries],
// // The selected service is used to store details when a user has clicked an autocomplete
selectedStations: [
diff --git a/src/globalState/MapContext.js b/src/globalState/MapContext.js
index 9f76240..52a18a0 100644
--- a/src/globalState/MapContext.js
+++ b/src/globalState/MapContext.js
@@ -1,4 +1,6 @@
import React, { useReducer, createContext } from 'react';
+// Import Helper functions
+import { getSearchParam, setSearchParam } from 'globalState/helpers/URLSearchParams'; // (used to sync state with URL)
export const MapContext = createContext(); // Create context
@@ -9,7 +11,7 @@ export const MapContextProvider = (props) => {
const initialState = {
mapRef: null,
mapContainer: null,
- mapView: true,
+ mapView: getSearchParam('mapView') !== 'false',
mapSize: {
width: 500,
height: 500,
@@ -35,6 +37,7 @@ export const MapContextProvider = (props) => {
switch (action.type) {
// Update view
case 'UPDATE_VIEW': {
+ setSearchParam('mapView', action.payload);
return {
...state,
mapView: action.payload,