@digitransit-component/digitransit-component-favourite-bar

2.0.5 • Public • Published

@digitransit-component/digitransit-component-favourite-bar

FavouriteBar

Extends React.Component

FavouriteBar renders favourites. FavouriteBar displays the first two favourites, the rest are shown in a list.

Parameters

  • props

Examples

<FavouriteBar
  favourites={favourites}
  onClickFavourite={onClickFavourite}
  onAddPlace={this.addPlace}
  onAddHome={this.addHome}
  onAddWork={this.addWork}
  lang={this.props.lang}
  isLoading={this.props.isLoading}
/>

favourites

Required. Array of favourites, favourite object contains following properties.

Type: Array<object>

Properties

onClickFavourite

Optional. Function for clicking favourites.

onAddPlace

Optional. Function for selecting "Add place" from suggestions.

onEdit

Optional. Function for selected "Edit" from suggestions.

onAddHome

Optional. Function for "Add home" button.

onAddWork

Optional. Function for "Add work" button.

lang

Optional. Language, fi, en or sv.

isLoading

Optional. Whether to show loading animation, true or false.

color

Optional. Default value is '#007ac9'.


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-favourite-bar

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

$ npm install @digitransit-component/digitransit-component

Package Sidebar

Install

npm i @digitransit-component/digitransit-component-favourite-bar

Weekly Downloads

41

Version

2.0.5

License

(AGPL-3.0 OR EUPL-1.2)

Unpacked Size

140 kB

Total Files

6

Last publish

Collaborators

  • digitransit