mirror of
https://github.com/HSLdevcom/digitransit-ui
synced 2026-02-01 13:00:49 +01:00
59 lines
1.6 KiB
JavaScript
59 lines
1.6 KiB
JavaScript
import PropTypes from 'prop-types';
|
|
import React from 'react';
|
|
import { matchShape } from 'found';
|
|
import { routeShape } from '../../../util/shapes';
|
|
import RouteControlPanel from '../RouteControlPanel';
|
|
|
|
/**
|
|
* ScheduleConstantOperation - Display constant operation route message
|
|
* Shown for routes that operate 24/7 instead of showing schedule
|
|
*/
|
|
const ScheduleConstantOperation = ({
|
|
constantOperationInfo,
|
|
match,
|
|
route,
|
|
breakpoint,
|
|
}) => {
|
|
return (
|
|
<div
|
|
className={`route-schedule-container ${
|
|
breakpoint !== 'large' ? 'mobile' : ''
|
|
}`}
|
|
>
|
|
<div className="constant-operation-panel">
|
|
<RouteControlPanel
|
|
match={match}
|
|
route={route}
|
|
breakpoint={breakpoint}
|
|
noInitialServiceDay
|
|
/>
|
|
</div>
|
|
<div className="stop-constant-operation-container bottom-padding">
|
|
<div className="constant-operation-content">
|
|
<span>{constantOperationInfo.text}</span>
|
|
<span className="constant-operation-link">
|
|
<a
|
|
href={constantOperationInfo.link}
|
|
target="_blank"
|
|
rel="noreferrer"
|
|
>
|
|
{constantOperationInfo.link}
|
|
</a>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
ScheduleConstantOperation.propTypes = {
|
|
constantOperationInfo: PropTypes.shape({
|
|
text: PropTypes.string.isRequired,
|
|
link: PropTypes.string.isRequired,
|
|
}).isRequired,
|
|
match: matchShape.isRequired,
|
|
route: routeShape.isRequired,
|
|
breakpoint: PropTypes.string.isRequired,
|
|
};
|
|
|
|
export default ScheduleConstantOperation;
|