-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5231 from HSLdevcom/DT-6654
DT-6654: Combine walk and wait cards
- Loading branch information
Showing
7 changed files
with
243 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React from 'react'; | ||
import cx from 'classnames'; | ||
import PropTypes from 'prop-types'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import RouteNumberContainer from '../../RouteNumberContainer'; | ||
import { routeShape } from '../../../util/shapes'; | ||
import Icon from '../../Icon'; | ||
|
||
const NaviBoardingInfo = ({ | ||
route, | ||
mode, | ||
headsign, | ||
translationValues, | ||
withExpandIcon, | ||
}) => { | ||
return ( | ||
<div className={cx('boarding', withExpandIcon && 'with-icon')}> | ||
<div className="route-info"> | ||
{withExpandIcon && ( | ||
<Icon img="navi-expand" className="icon-expand-small" /> | ||
)} | ||
<RouteNumberContainer | ||
className={cx('line', mode)} | ||
route={route} | ||
mode={mode} | ||
isTransitLeg | ||
vertical | ||
withBar | ||
/> | ||
<div className="headsign">{headsign}</div> | ||
</div> | ||
<div className="wait-duration"> | ||
<FormattedMessage | ||
id="navileg-departing-at" | ||
defaultMessage="{duration} min päästä klo {legTime}" | ||
values={translationValues} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
NaviBoardingInfo.propTypes = { | ||
route: routeShape.isRequired, | ||
mode: PropTypes.string.isRequired, | ||
headsign: PropTypes.string.isRequired, | ||
// eslint-disable-next-line react/forbid-prop-types | ||
translationValues: PropTypes.object.isRequired, | ||
withExpandIcon: PropTypes.bool, | ||
}; | ||
NaviBoardingInfo.defaultProps = { | ||
withExpandIcon: false, | ||
}; | ||
|
||
export default NaviBoardingInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.