mirror of
https://github.com/HSLdevcom/digitransit-ui
synced 2025-09-21 22:02:50 +02:00
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
import PropTypes from 'prop-types';
|
|
import React from 'react';
|
|
import { createFragmentContainer, graphql } from 'react-relay';
|
|
import StopPageMap from './map/StopPageMap';
|
|
|
|
const BikeRentalStationPageMapContainer = ({ bikeRentalStation }) => {
|
|
if (!bikeRentalStation) {
|
|
return false;
|
|
}
|
|
return <StopPageMap stop={bikeRentalStation} citybike />;
|
|
};
|
|
|
|
BikeRentalStationPageMapContainer.contextTypes = {
|
|
config: PropTypes.object.isRequired,
|
|
};
|
|
|
|
BikeRentalStationPageMapContainer.propTypes = {
|
|
bikeRentalStation: PropTypes.shape({
|
|
lat: PropTypes.number.isRequired,
|
|
lon: PropTypes.number.isRequired,
|
|
name: PropTypes.string,
|
|
}),
|
|
};
|
|
|
|
BikeRentalStationPageMapContainer.defaultProps = {
|
|
bikeRentalStation: undefined,
|
|
};
|
|
|
|
const containerComponent = createFragmentContainer(
|
|
BikeRentalStationPageMapContainer,
|
|
{
|
|
bikeRentalStation: graphql`
|
|
fragment BikeRentalStationPageMapContainer_bikeRentalStation on BikeRentalStation {
|
|
lat
|
|
lon
|
|
name
|
|
}
|
|
`,
|
|
},
|
|
);
|
|
|
|
export {
|
|
containerComponent as default,
|
|
BikeRentalStationPageMapContainer as Component,
|
|
};
|