2.0.0 • Published 10 months ago

@digitransit-component/digitransit-component-control-panel v2.0.0

Weekly downloads
282
License
(AGPL-3.0 OR EUPL...
Repository
github
Last release
10 months ago

@digitransit-component/digitransit-component-control-panel

NearStopsAndRoutes

Show button links to near you page for different travel modes

Parameters

  • props Object
    • props.modes Array<string> Names of transport modes to show buttons for. Should be in lower case. Also defines button order
    • props.urlPrefix string URL prefix for links. Must end with /lahellasi
    • props.language string Language used for accessible labels
    • props.showTitle boolean Show title, default is false
    • props.alertsContext Object
      • props.alertsContext.getModesWithAlerts function Function which should return an array of transport modes that have active alerts (e.g. BUS, SUBWAY)
      • props.alertsContext.currentTime Number Time stamp with which the returned alerts are validated with
      • props.alertsContext.feedIds Number feedIds for which the alerts are fetched for
    • props.LinkComponent element React component for creating a link, default is undefined and normal anchor tags are used
    • props.origin
    • props.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-panel

Or install the digitransit-component module that includes it as a class:

$ npm install @digitransit-component/digitransit-component
2.0.0

10 months ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

4 years ago

0.3.20

4 years ago

0.3.19

4 years ago

0.3.17

4 years ago

0.3.18

4 years ago

0.3.16

4 years ago

0.3.15

4 years ago

0.3.14

4 years ago

0.3.13

4 years ago

0.3.12

4 years ago

0.3.11

4 years ago

0.3.10

4 years ago

0.3.9

4 years ago

0.3.8

4 years ago

0.3.7

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago