Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
175 commits
Select commit Hold shift + click to select a range
10a3f13
fix: location prop name for search
vesameskanen Nov 18, 2025
b4cc48d
Merge branch 'v3' into AB#74
vesameskanen Nov 27, 2025
5652a79
fix: remove unnecessary div with nonexistent style class
vesameskanen Nov 27, 2025
40c5a7b
chore: rename variables
vesameskanen Nov 27, 2025
dcaab48
chore: refactor DepartureRow
vesameskanen Nov 27, 2025
e9f1167
fix: use simple callback prop for capacity modal opening
vesameskanen Nov 27, 2025
754dc11
chore: remove useless prop
vesameskanen Nov 27, 2025
2c86889
chore: use consistently favourite (not favorite)
vesameskanen Nov 27, 2025
ca95d57
chore: rename more components
vesameskanen Nov 27, 2025
e35ab5e
fix: remove invalid param from executeAction
vesameskanen Nov 27, 2025
80003b3
fix: strange double expression
vesameskanen Nov 28, 2025
10e9de3
fix: various update bugs
vesameskanen Nov 28, 2025
4bc76ab
fix: NearYouFavouritesMapContainer props
vesameskanen Nov 28, 2025
09aec9e
fix: hundreds of relay warnings caused by missing vehicle rental stat…
vesameskanen Nov 28, 2025
2ce8c71
fix: favourite vehicle rental station prop name errors
vesameskanen Nov 28, 2025
15af1ea
chore: remove fake props
vesameskanen Nov 28, 2025
faf7995
fix: remove useless connection with 2 stores
vesameskanen Nov 28, 2025
857d32d
chore: remove unused prop
vesameskanen Nov 28, 2025
010b38d
chore: refactor StopNearYou
vesameskanen Nov 28, 2025
84cc123
chore: refactor VehicleRentalStationNearYou
vesameskanen Nov 28, 2025
4b79ac8
fix: remove unnecessary store connection from NearYouContainer
vesameskanen Nov 29, 2025
946c8df
fix: remove unnecessary store connections from NearYouMapContainer
vesameskanen Dec 2, 2025
8d6ed1f
fix: favouriteIds is required prop, code will crash without it
vesameskanen Dec 3, 2025
851095c
chore: refactor
vesameskanen Dec 3, 2025
a81847d
fix: wrong prop type for FavouritesMapContainer
vesameskanen Dec 3, 2025
2d2c101
fix: pass correct favouriteIds set prop to NearYouContainer
vesameskanen Dec 3, 2025
ddafa1b
chore: refactor and rename
vesameskanen Dec 3, 2025
9e58c51
fix: correct stopsNearYou prop type
vesameskanen Dec 3, 2025
2b66e85
feat: refactor NearYouContainer thoroughly
vesameskanen Dec 7, 2025
66c0ccc
chore: rename
vesameskanen Dec 8, 2025
0973d61
feat: move update button to sub component
vesameskanen Dec 8, 2025
b924aea
feat: move top level map rendering logic to a new component
vesameskanen Dec 9, 2025
004640a
chore: rename more
vesameskanen Dec 9, 2025
f630726
feat: move modal which asks initial location into new component
vesameskanen Dec 9, 2025
0709288
fix: give understandable names for the two search components
vesameskanen Dec 9, 2025
62a1f61
feat: move location search into sub component
vesameskanen Dec 10, 2025
7a1616d
chore: refactor searches more
vesameskanen Dec 10, 2025
e29e822
chore: refactor searches more
vesameskanen Dec 10, 2025
5809c76
feat: convert NearYouPage to function and refactor it
vesameskanen Dec 10, 2025
f73ff90
fix: update renamed props in map component, too
vesameskanen Dec 11, 2025
96de343
Merge branch 'v3' into AB#74-patch1
vesameskanen Dec 17, 2025
94aa516
fix: buggy LocationMarker key, remove unnecessary wrapper func
vesameskanen Dec 17, 2025
6ec7a3c
chore: refactor route and vehicle drawing on near you map
vesameskanen Dec 17, 2025
59919b6
chore: refactor near you map more
vesameskanen Dec 17, 2025
9cf8100
fix: remove unnecessary stop list conversion to another data type, re…
vesameskanen Dec 17, 2025
35ad0ee
fix: show vehicles on favourites near you map
vesameskanen Dec 17, 2025
5e85d29
fix: remove unused query fields and arguments from fav map container
vesameskanen Dec 18, 2025
0d72539
fix: remove triple code in favourite mapping
vesameskanen Dec 18, 2025
1b90286
fix: remove unncessary near youy map container query fields and argum…
vesameskanen Dec 18, 2025
453d70d
fix: remove strange relay.loadMore from near you map
vesameskanen Dec 18, 2025
d893c85
chore: simplify nearyou code more
vesameskanen Dec 23, 2025
b85aa68
feat: move city bike info to own component
vesameskanen Dec 23, 2025
4c32d91
fix: don't render 0
vesameskanen Dec 23, 2025
7fe3728
Merge branch 'v3' into AB#74-patch1
vesameskanen Dec 23, 2025
cc90356
fix: restore bike season
vesameskanen Dec 23, 2025
21fe5e1
fix: use standard severe alert color for low city bike capacity
vesameskanen Dec 29, 2025
b6f672c
fix: use color variable instead of hard coded value
vesameskanen Dec 29, 2025
49717c6
fix: favourites were available only in HSL itinerary page search
vesameskanen Dec 29, 2025
8db2885
feat: method which counts favourite locations
vesameskanen Dec 29, 2025
2a62c60
fix: add 'own locations' sub menu only if fav locations exist
vesameskanen Dec 29, 2025
e6eb980
chore: inherit config values from base config
vesameskanen Dec 29, 2025
8f6d80c
chore: refactor nearyou props
vesameskanen Dec 30, 2025
2f4ab0e
fix: refactor the insane prop spaghetti of near you buttons
vesameskanen Dec 30, 2025
b9f4497
feat: use refactored near you button component
vesameskanen Dec 30, 2025
24cb10d
fix: new bugs after refactoring
vesameskanen Dec 30, 2025
9420f61
chore: remove unused config
vesameskanen Dec 30, 2025
b28af44
fix: use nearyou consistently (no more nearbys)
vesameskanen Dec 30, 2025
2321b8a
fix: remove dead Ctrlpanel props
vesameskanen Dec 31, 2025
5ebad4d
feat: support bike and car park modes in CtrlPanel
vesameskanen Dec 31, 2025
7df4b4d
feat: update near you title and some translations
vesameskanen Dec 31, 2025
0c11ff8
feat: new component for near you parks
vesameskanen Jan 2, 2026
6a16ab5
feat: park support in map wrapper
vesameskanen Jan 2, 2026
f2ed65f
feat: support parks in NearYouContainer
vesameskanen Jan 2, 2026
5cde0b9
feat: NearYouMap supports parks
vesameskanen Jan 2, 2026
d8de407
feat: support parks in NearYouMapContainer
vesameskanen Jan 2, 2026
3918758
fix: remove useless prop
vesameskanen Jan 2, 2026
a605c0a
chore: park modes without hyphen, for consistency
vesameskanen Jan 2, 2026
527a9d9
feat: NearYouPage supports parks
vesameskanen Jan 2, 2026
f115b13
fix: rename park capacity
vesameskanen Jan 2, 2026
4c7cd26
chore: tune
vesameskanen Jan 2, 2026
a32c75c
fix: add maxDistance to new modes, rename
vesameskanen Jan 2, 2026
7a6ad8e
fix: alert rendering jsx syntax
vesameskanen Jan 2, 2026
14b3cab
feat: add translations
vesameskanen Jan 2, 2026
a4b4f62
feat: park specific search
vesameskanen Jan 2, 2026
aa58dc8
fix: allow map rendering while query is not finished yet
vesameskanen Jan 5, 2026
e9a7e95
feat: add svg for vertical park icons
vesameskanen Jan 5, 2026
154ff63
fix: Give sensible name for part of icons
vesameskanen Jan 5, 2026
4169d00
chore: major version bump after breaking icon name change
vesameskanen Jan 5, 2026
77df3a2
fix: icon naming chaos
vesameskanen Jan 5, 2026
332f8f6
feat: use new icon names in suggestion item
vesameskanen Jan 6, 2026
e0c3788
chore: remove unused icon
vesameskanen Jan 6, 2026
37a85d4
fix: translation ids
vesameskanen Jan 6, 2026
b51f563
feat: use new icon names in control panel
vesameskanen Jan 6, 2026
5c7a2c4
fix: do not use fake 'waltti' modeset
vesameskanen Jan 6, 2026
b2f0f6d
fix: remove duplicate bus express icons
vesameskanen Jan 6, 2026
b691b18
fix: update dependency versions
vesameskanen Jan 6, 2026
9836269
fix: use proper array.includes call
vesameskanen Jan 7, 2026
e3b7702
chore: refactor more
vesameskanen Jan 7, 2026
f20b21c
fix: remove redundant icon mappings
vesameskanen Jan 7, 2026
d600afc
feat: theme colors for parks
vesameskanen Jan 7, 2026
980af6d
fix: add missing default theme colors
vesameskanen Jan 7, 2026
65049f9
fix: scale new park fill svg to fit the round container in vertical b…
vesameskanen Jan 7, 2026
d8b33a3
fix: add mapping for subway-stop
vesameskanen Jan 7, 2026
8a0b64b
fix: Icon library to obey configured colors
vesameskanen Jan 7, 2026
d356a70
fix: remove duplicate icons
vesameskanen Jan 7, 2026
6a45c69
fix: app code uses replacement-bus not bus-replacement
vesameskanen Jan 7, 2026
ef8579b
chore: optimize Icon library svgs
vesameskanen Jan 7, 2026
6c047b1
feat: map park colors
vesameskanen Jan 7, 2026
bd0e664
chore: enable parks for HSL
vesameskanen Jan 7, 2026
97aea3e
chore: update nearyou translations
vesameskanen Jan 7, 2026
babc42c
fix: return null not undefined from react component
vesameskanen Jan 7, 2026
36ebb2e
fix: react key props
vesameskanen Jan 8, 2026
f80f26b
fix: allow map rendering without props from favorite query
vesameskanen Jan 8, 2026
97cb258
fix: more query fields for parking
vesameskanen Jan 8, 2026
ea2a855
chore: tune query fields
vesameskanen Jan 8, 2026
8f4efcd
fix: relay wants null not undefined from query
vesameskanen Jan 8, 2026
66a9702
Merge branch 'v3' into AB#74-patch1
vesameskanen Jan 8, 2026
aaf1f90
feat: optional park info
vesameskanen Jan 8, 2026
7ee1249
fix: back button is optional in park card
vesameskanen Jan 8, 2026
c328722
fix: remove double shadow in park and rental mobile views
vesameskanen Jan 8, 2026
73d3c7b
fix: add all relevant parking props to nearyou query
vesameskanen Jan 8, 2026
38282f1
chore: version bump
vesameskanen Jan 8, 2026
51d2f6d
chore: updated NearYouMap from next
vesameskanen Jan 8, 2026
56a88ae
chore: some updates from next
vesameskanen Jan 8, 2026
b0da6a8
Merge branch 'v3' into AB#74
vesameskanen Jan 9, 2026
816c97f
feat: set a limit to horizontal nearyou button count
vesameskanen Jan 9, 2026
26f8c43
fix: Simo's park component style fixes from next
vesameskanen Jan 9, 2026
0e66bb9
feat: add 'show more' button when nearyou icons won't fit
vesameskanen Jan 9, 2026
9a1afdb
feat: generalize color configuration
vesameskanen Jan 10, 2026
f47b7fa
fix: smaller near you arrow icon
vesameskanen Jan 10, 2026
df11414
fix: bad funicular svg
vesameskanen Jan 10, 2026
862fa6f
chore: simplify suggestion item styling mess a bit
vesameskanen Jan 10, 2026
16b8d48
chore: simplify transit mode icons
vesameskanen Jan 10, 2026
c08d3e2
fix: remove hard coded size from library icons, normalize viewbox
vesameskanen Jan 11, 2026
9660dba
fix: proper scaling for vertical nearyou svg
vesameskanen Jan 11, 2026
5f64419
fix: add mapping for airplane stop
vesameskanen Jan 11, 2026
4c863d3
feat: remove unnecessary repeating fallback color handling
vesameskanen Jan 11, 2026
1cc819a
fix: render arrows using theme color
vesameskanen Jan 11, 2026
40974eb
fix: pass iconColors to favourite search
vesameskanen Jan 11, 2026
1cd9e1d
chore: remove the rest of unnecessary runtime color validation
vesameskanen Jan 12, 2026
f12f71c
feat: import default colors from a single place
vesameskanen Jan 12, 2026
5f01070
feat: add caution color to config
vesameskanen Jan 12, 2026
882476f
fix: unify theme color handling in component libraries
vesameskanen Jan 12, 2026
8a1acfc
chore: update UI app to use new unified component color prop
vesameskanen Jan 12, 2026
52a1f88
test: update unit tests
vesameskanen Jan 12, 2026
b3777c4
fix: two more HSL theme color usages removed
vesameskanen Jan 12, 2026
6e2db6c
fix: remove hard coded HSL colors from navigator icons
vesameskanen Jan 12, 2026
84f4eb2
chore: bit more svg cleaning
vesameskanen Jan 13, 2026
15fd8c5
fix: remove ugly hack for swapping HSL locate icon
vesameskanen Jan 13, 2026
7872700
feat: open modal from nearyou extension arrow
vesameskanen Jan 13, 2026
5cdaf59
feat: move horizontal button to a sub component
vesameskanen Jan 13, 2026
9a53353
fix: remove duplicate rendering code
vesameskanen Jan 13, 2026
a7ef4aa
fix: hsl bus stop svg
vesameskanen Jan 13, 2026
a51782b
feat: move modal and vertical button to sub componets
vesameskanen Jan 13, 2026
4f60d87
feat: render nearyou links into the modal
vesameskanen Jan 14, 2026
4b7347d
feat: refactor modal implementation and improve styles
vesameskanen Jan 14, 2026
4dcea14
fix: via point icon name
vesameskanen Jan 15, 2026
ee0cb03
fix: modal button styles
vesameskanen Jan 15, 2026
4b1c29f
feat: shorter modal button labels
vesameskanen Jan 15, 2026
ffbb19f
feat: optional button border
vesameskanen Jan 15, 2026
fbbbcc8
feat: add desktop modal description, improve styles
vesameskanen Jan 15, 2026
4dfbd95
chore: add separator lines
vesameskanen Jan 15, 2026
fe2e397
chore: remove unused style export file
vesameskanen Jan 16, 2026
0a7d018
chore: group near you settings together
vesameskanen Jan 16, 2026
5413425
fix: render separator line in modal button wrapper
vesameskanen Jan 16, 2026
e2c2999
feat: add separator line under modal buttons
vesameskanen Jan 16, 2026
6e2f437
feat: add close button to modal, tune styles
vesameskanen Jan 16, 2026
0320567
chore: simplify styles
vesameskanen Jan 16, 2026
99ea27c
fix: remove outdated color props, add the required one to itinery page
vesameskanen Jan 19, 2026
4082eb7
fix: remove useless props from OriginDestinationBar
vesameskanen Jan 19, 2026
5622571
fix: mobile search defines back arrow color
vesameskanen Jan 19, 2026
0aaec97
fix: hover style for borderless nearyouy modal buttons
vesameskanen Jan 20, 2026
ccde4a7
chore: reset test configuration changes
vesameskanen Jan 20, 2026
c6dc306
chore: sync digitransit components with next
vesameskanen Jan 20, 2026
7090e6f
chore: review fixes from next PR
vesameskanen Jan 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/component/AlertBanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const AlertBanner = ({ alerts, linkAddress }, { config }) => {
alert.alertSeverityLevel !== 'INFO'
? 'icon_caution_white_exclamation'
: 'icon_info';
const iconColor = alert.alertSeverityLevel !== 'INFO' ? '#DC0451' : '#888';
const iconColor =
alert.alertSeverityLevel !== 'INFO' ? config.colors.caution : '#888';
return (
<Link
className={`alert-banner-link ${alert.alertSeverityLevel.toLowerCase()}`}
Expand Down
16 changes: 8 additions & 8 deletions app/component/DepartureRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import { routePagePath, PREFIX_STOPS } from '../util/path';
import { configShape, departureShape } from '../util/shapes';
import { epochToTime } from '../util/timeUtils';
import Icon from './Icon';
import PlatformNumber from './PlatformNumber';
import IconBackground from './icon/IconBackground';
import PlatformNumber from './PlatformNumber';

const getMostSevereAlert = route => {
const alerts = [...getAlertsForObject(route)];
Expand Down Expand Up @@ -51,7 +51,7 @@ export default function DepartureRow(
let backgroundClass;
let sr;
if (
route?.alerts?.filter(alert => isAlertValid(alert, props.currentTime))
route.alerts?.filter(alert => isAlertValid(alert, props.currentTime))
?.length > 0
) {
const alert = getMostSevereAlert(route);
Expand All @@ -65,17 +65,17 @@ export default function DepartureRow(
if (alert.alertSeverityLevel === 'INFO') {
icon = 'icon_info';
iconColor = '#888';
background = <IconBackground backgroundShape="circle" />;
background = <IconBackground shape="circle" />;
backgroundClass = 'circle';
} else {
icon = 'icon_caution-white-excl-stroke';
iconColor = '#DC0451';
iconColor = config.colors.caution;
}
}
const headsign =
departure.headsign ||
trip.tripHeadsign ||
getHeadsignFromRouteLongName(trip.route);
getHeadsignFromRouteLongName(route);
let shownTime;
if (timeDiffInMinutes <= 0) {
shownTime = intl.formatMessage({
Expand All @@ -93,7 +93,7 @@ export default function DepartureRow(
{ minutes: timeDiffInMinutes },
);
}
const { shortName } = trip.route;
const { shortName } = route;
const lowerCaseShortName = shortName?.toLowerCase();
const nameOrIcon =
shortName?.length > 6 || !shortName?.length ? (
Expand Down Expand Up @@ -166,7 +166,7 @@ export default function DepartureRow(
className={cx('route-number-container', {
long: shortName && shortName.length <= 6 && shortName.length >= 5,
})}
style={{ backgroundColor: `#${trip.route.color}` }}
style={{ backgroundColor: `#${route.color}` }}
>
<div aria-hidden="true" className="route-number">
{nameOrIcon}
Expand All @@ -188,7 +188,7 @@ export default function DepartureRow(
</td>
<td className={cx('route-headsign', departure.bottomRow ? 'bottom' : '')}>
<div className="headsign">
{headsign} {departure.bottomRow && departure.bottomRow}
{headsign} {departure.bottomRow}
</div>
</td>
<td className="time-cell">
Expand Down
23 changes: 5 additions & 18 deletions app/component/FavouritesContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
} from '../action/FavouriteActions';
import FavouriteStore from '../store/FavouriteStore';
import { addAnalyticsEvent } from '../util/analyticsUtils';
import { LightenDarkenColor } from '../util/colorUtils';

const AutoSuggestWithSearchContext = withSearchContext(AutoSuggest);

Expand Down Expand Up @@ -54,8 +53,6 @@ class FavouritesContainer extends React.Component {
favouriteModalAction: PropTypes.string,
requireLoggedIn: PropTypes.bool,
isLoggedIn: PropTypes.bool,
color: PropTypes.string,
hoverColor: PropTypes.string,
};

static defaultProps = {
Expand All @@ -65,8 +62,6 @@ class FavouritesContainer extends React.Component {
requireLoggedIn: false,
isLoggedIn: false,
favouriteModalAction: undefined,
color: undefined,
hoverColor: undefined,
lang: undefined,
};

Expand Down Expand Up @@ -250,8 +245,7 @@ class FavouritesContainer extends React.Component {
loginModalOpen: false,
});
}}
color={this.props.color}
hoverColor={this.props.hoverColor}
colors={this.context.config.colors}
/>
);
};
Expand Down Expand Up @@ -358,7 +352,7 @@ class FavouritesContainer extends React.Component {
}
lang={this.props.lang}
isLoading={isLoading}
color={this.props.color}
colors={config.colors}
fontWeights={fontWeights}
/>
<FavouriteModal
Expand All @@ -371,6 +365,7 @@ class FavouritesContainer extends React.Component {
lang={this.props.lang}
isMobile={this.props.isMobile}
fontWeights={fontWeights}
colors={config.colors}
autosuggestComponent={
<AutoSuggestWithSearchContext
appElement="#app"
Expand All @@ -386,16 +381,13 @@ class FavouritesContainer extends React.Component {
getAutoSuggestIcons={config.getAutoSuggestIcons}
lang={this.props.lang}
isMobile={this.props.isMobile}
color={this.props.color}
hoverColor={this.props.hoverColor}
fontWeights={fontWeights}
required
colors={config.colors}
modeSet={config.iconModeSet}
favouriteContext
/>
}
color={this.props.color}
hoverColor={this.props.hoverColor}
/>
<FavouriteEditModal
appElement="#app"
Expand All @@ -409,8 +401,7 @@ class FavouritesContainer extends React.Component {
lang={this.props.lang}
isMobile={this.props.isMobile}
isLoading={isLoading}
color={this.props.color}
hoverColor={this.props.hoverColor}
colors={config.colors}
fontWeights={fontWeights}
/>
{this.renderLoginModal()}
Expand All @@ -434,10 +425,6 @@ const connectedComponent = connectToStores(
isLoggedIn:
context.config.allowLogin &&
context.getStore('UserStore').getUser().sub !== undefined,
color: context.config.colors.primary,
hoverColor:
context.config.colors.hover ||
LightenDarkenColor(context.config.colors.primary, -20),
}),
);

Expand Down
4 changes: 1 addition & 3 deletions app/component/IconWithIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ const IconWithIcon = (
<Icon
img={subIcon}
omitViewBox={omitViewBox}
background={
subIconShape && <IconBackground backgroundShape={subIconShape} />
}
background={subIconShape && <IconBackground shape={subIconShape} />}
/>
</span>
)}
Expand Down
91 changes: 42 additions & 49 deletions app/component/IndexPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import { addAnalyticsEvent } from '../util/analyticsUtils';
import withBreakpoint from '../util/withBreakpoint';
import Geomover from './Geomover';
import scrollTop from '../util/scroll';
import { LightenDarkenColor } from '../util/colorUtils';
import { getRefPoint } from '../util/apiUtils';
import { filterObject } from '../util/filterUtils';
import {
Expand Down Expand Up @@ -229,49 +228,52 @@ class IndexPage extends React.Component {
const { intl, config } = this.context;
const { colors, fontWeights } = config;
const { lang } = this.props;
const transportModes = getTransportModes(config);
const nearYouModes = getNearYouModes(config);

// Styles are defined by which button type is configured (narrow/wide)
const narrowButtons = config.narrowNearYouButtons;
const modeTitles = filterObject(
transportModes,
'availableForSelection',
true,
);
// If nearYouModes is configured, display those. Otherwise, display all configured transport modes
const modes =
nearYouModes?.length > 0 ? nearYouModes : Object.keys(modeTitles);
const modeArray =
nearYouModes.length > 0
? nearYouModes
: Object.keys(
filterObject(
getTransportModes(config),
'availableForSelection',
true,
),
);

const alertsContext = {
currentTime: this.props.currentTime,
getModesWithAlerts,
feedIds: config.feedIds,
};

const directionProps = config.narrowNearYouButtons
? {}
: { horizontal: false };

return config.showNearYouButtons ? (
<CtrlPanel.NearStopsAndRoutes
modeArray={modes}
appElement="#app"
modeArray={modeArray}
modeSet={config.iconModeSet}
urlPrefix={`/${PREFIX_NEARYOU}`}
language={lang}
showTitle
title={config.nearYouTitle}
alertsContext={alertsContext}
origin={this.props.origin}
omitLanguageUrl
onClick={this.clickStopNearIcon}
buttonStyle={narrowButtons ? undefined : config.nearYouButton}
title={narrowButtons ? undefined : config.nearYouTitle}
modes={narrowButtons ? undefined : modeTitles}
modeSet={config.nearbyModeSet || config.iconModeSet}
modeIconColors={colors.iconColors}
colors={colors}
fontWeights={fontWeights}
{...directionProps}
isMobile={this.props.breakpoint !== 'large'}
/>
) : (
<div className="stops-near-you-text">
<h2>
{intl.formatMessage({
id: 'stop-near-you-title',
defaultMessage: 'Stops and lines near you',
id: 'near-you-search',
defaultMessage: 'Search stops and routes',
})}
</h2>
</div>
Expand All @@ -282,18 +284,18 @@ class IndexPage extends React.Component {
render() {
const { intl, config } = this.context;
const { trafficNowLink, colors, fontWeights } = config;
const color = colors.primary;
const hoverColor = colors.hover || LightenDarkenColor(colors.primary, -20);
const accessiblePrimaryColor = colors.accessiblePrimary || colors.primary;
const { breakpoint, lang } = this.props;
const origin = this.pendingOrigin || this.props.origin;
const destination = this.pendingDestination || this.props.destination;
const locationSources = ['History', 'Datasource'];
const sources = ['Favourite', 'History', 'Datasource'];
const stopAndRouteSearchTargets = ['Stations', 'Stops', 'Routes'];
const targets = getLocationSearchTargets(config, breakpoint !== 'large');

targets.push('FutureRoutes');

if (this.context.getStore('FavouriteStore').getLocationCount()) {
locationSources.push('Favourite');
}
if (!config.targetsFromOTP) {
if (useCitybikes(config.vehicleRental?.networks, config)) {
stopAndRouteSearchTargets.push('VehicleRentalStations');
Expand All @@ -312,11 +314,8 @@ class IndexPage extends React.Component {
origin,
destination,
lang,
sources,
locationSources,
targets,
color,
hoverColor,
accessiblePrimaryColor,
refPoint,
searchPanelText: intl.formatMessage({
id: 'where',
Expand All @@ -329,7 +328,7 @@ class IndexPage extends React.Component {
onGeolocationStart: this.onSelectLocation,
fromMap: this.props.fromMap,
fontWeights,
modeIconColors: colors.iconColors,
colors,
modeSet: config.iconModeSet,
};

Expand All @@ -343,13 +342,10 @@ class IndexPage extends React.Component {
getAutoSuggestIcons: config.getAutoSuggestIcons,
value: '',
lang,
color,
hoverColor,
accessiblePrimaryColor,
sources,
targets: stopAndRouteSearchTargets,
fontWeights,
modeIconColors: colors.iconColors,
colors,
modeSet: config.iconModeSet,
geocodingSize: 25,
};
Expand All @@ -375,13 +371,7 @@ class IndexPage extends React.Component {
<h1 className="sr-only">
<FormattedMessage id="index.title" default="Journey Planner" />
</h1>
<CtrlPanel
instance="hsl"
language={lang}
origin={origin}
position="left"
fontWeights={fontWeights}
>
<CtrlPanel position="left" fontWeights={fontWeights}>
<span className="sr-only">
<FormattedMessage
id="search-fields.sr-instructions"
Expand All @@ -390,7 +380,11 @@ class IndexPage extends React.Component {
</span>
<LocationSearch {...locationSearchProps} />
<div className="datetimepicker-container">
<DatetimepickerContainer realtime color={color} lang={lang} />
<DatetimepickerContainer
realtime
color={colors.primary}
lang={lang}
/>
</div>
{!config.hideFavourites && (
<>
Expand Down Expand Up @@ -433,19 +427,18 @@ class IndexPage extends React.Component {
backgroundColor: '#ffffff',
}}
>
<CtrlPanel
instance="hsl"
language={lang}
position="bottom"
fontWeights={fontWeights}
>
<CtrlPanel position="bottom" fontWeights={fontWeights}>
<LocationSearch
disableAutoFocus
isMobile
{...locationSearchProps}
/>
<div className="datetimepicker-container">
<DatetimepickerContainer realtime color={color} lang={lang} />
<DatetimepickerContainer
realtime
color={colors.primary}
lang={lang}
/>
</div>
<FavouritesContainer
onClickFavourite={this.clickFavourite}
Expand Down
Loading
Loading