mirror of
https://github.com/HSLdevcom/digitransit-ui
synced 2025-07-07 19:30:41 +02:00
.. | ||
src | ||
index.js | ||
LICENSE-AGPL.txt | ||
LICENSE-EUPL.txt | ||
package.json | ||
README.md | ||
test.js |
@digitransit-component/digitransit-component-favourite-modal
FavouriteModal
Extends React.Component
Parameters
props
Examples
<FavouriteModal
show={modalOpen}
handleClose={handleClose}
saveFavourite={onSaveFavourite}
location={selectedLocation}
favourite={favourite}
lang={lang}
autosuggestComponent={
<AutoSuggest
sources={['History', 'Datasource']}
targets={['Locations', 'CurrentPosition']}
id="favourite"
autoFocus={false}
placeholder="search-address-or-place"
value={selectedLocation.address || ''}
onFavouriteSelected={this.setLocationProperties}
lang={lang}
/>
}
/>
handleClose
Required.
Type: function
saveFavourite
Required.
Type: function
cancelSelected
Required. Only used when editing favourite.
Type: function
autosuggestComponent
Optional. Autosuggest component for searching new favourites.
Type: node
favourite
Optional. Object to prefill input field for name and/or selected icon.
Type: object
Properties
type
stringaddress
stringgtfsId
stringgid
stringlat
numberlon
numbername
stringselectedIconId
stringfavouriteId
stringlayer
stringdefaultName
string
addAnalyticsEvent
Optional.
Type: function
lang
Optional. Language, fi, en or sv.
Type: string
isMobile
Optional.
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-modal
Or install the digitransit-component module that includes it as a class:
$ npm install @digitransit-component/digitransit-component