Extends React.Component
FavouriteBar renders favourites. FavouriteBar displays the first two favourites, the rest are shown in a list.
props
<FavouriteBar
favourites={favourites}
onClickFavourite={onClickFavourite}
onAddPlace={this.addPlace}
onAddHome={this.addHome}
onAddWork={this.addWork}
lang={this.props.lang}
isLoading={this.props.isLoading}
/>
Required. Array of favourites, favourite object contains following properties.
-
address
string -
gtfsId
string -
gid
string -
lat
number -
lon
number -
name
string -
selectedIconId
string -
favouriteId
string
Optional. Function for clicking favourites.
Optional. Function for selecting "Add place" from suggestions.
Optional. Function for selected "Edit" from suggestions.
Optional. Function for "Add home" button.
Optional. Function for "Add work" button.
Optional. Language, fi, en or sv.
Optional. Whether to show loading animation, true or false.
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.
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