digitransit-ui/app/component/SettingsDrawer.js
2021-03-17 08:16:09 +02:00

26 lines
664 B
JavaScript

import PropTypes from 'prop-types';
import React from 'react';
import { intlShape } from 'react-intl';
import { matchShape, routerShape } from 'found';
export const SettingsDrawer = ({ children, open, className }) => {
if (open) {
return <div className={className}>{children}</div>;
}
return null;
};
SettingsDrawer.propTypes = {
open: PropTypes.bool.isRequired,
className: PropTypes.string.isRequired,
children: PropTypes.node.isRequired,
};
SettingsDrawer.contextTypes = {
config: PropTypes.object.isRequired,
intl: intlShape.isRequired,
router: routerShape.isRequired,
match: matchShape.isRequired,
};
export default SettingsDrawer;