@digitransit-component/digitransit-component-control-panel v2.0.1
@digitransit-component/digitransit-component-control-panel
NearStopsAndRoutes
Show button links to near you page for different travel modes
Parameters
propsObjectprops.modesArray<string> Names of transport modes to show buttons for. Should be in lower case. Also defines button orderprops.urlPrefixstring URL prefix for links. Must end with /lahellasiprops.languagestring Language used for accessible labelsprops.showTitleboolean Show title, default is falseprops.alertsContextObjectprops.alertsContext.getModesWithAlertsfunction Function which should return an array of transport modes that have active alerts (e.g. BUS, SUBWAY)props.alertsContext.currentTimeNumber Time stamp with which the returned alerts are validated withprops.alertsContext.feedIdsNumber feedIds for which the alerts are fetched for
props.LinkComponentelement React component for creating a link, default is undefined and normal anchor tags are usedprops.originprops.omitLanguageUrl
Examples
const alertsContext = {
getModesWithAlerts: () => ({}),
currentTime: 123456789,
feedIds: [HSL]
}
<CtrlPanel.NearStopsAndRoutes
modes={['bus', 'tram', 'subway', 'rail', 'ferry', 'citybike']}
language="fi"
urlPrefix="http://example.com/lahellasi"
showTitle
alertsContext={alertsContext}
/>CtrlPanel
Extends React.Component
CtrlPanel gathers multiple components to same area (desktop-size: left or mobile-size: bottom)
Examples
<CtrlPanel language="fi" position="left">
<CtrlPanel.OriginToDestination showTitle />
<CtrlPanel.SeparatorLine />
<CtrlPanel.NearStopsAndRoutes
modes={['bus', 'tram', 'subway', 'rail', 'ferry', 'citybike']}
language="fi"
urlPrefix="http://example.com/lahellasi"
showTitle
/>
</CtrlPanel>This module is part of the Digitransit-ui project. It is maintained in the HSLdevcom/digitransit-ui repository, where you can create PRs and issues.
Installation
Install this module individually:
$ npm install @digitransit-component/digitransit-component-control-panelOr install the digitransit-component module that includes it as a class:
$ npm install @digitransit-component/digitransit-component5 months ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago