@digitransit-component/digitransit-component-favourite-bar
v2.0.5
Published
digitransit-component favourite-bar module
Downloads
56
Maintainers
Readme
@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.
Properties
address
stringgtfsId
stringgid
stringlat
numberlon
numbername
stringselectedIconId
stringfavouriteId
string
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