2017-06-03 21:03:48 +02:00
|
|
|
import React from 'react';
|
2017-05-21 10:02:51 +02:00
|
|
|
import PropTypes from 'prop-types';
|
2017-04-28 15:47:14 +10:00
|
|
|
|
2017-06-03 21:03:48 +02:00
|
|
|
import './breakpoints.css';
|
2017-04-28 15:47:14 +10:00
|
|
|
|
2017-06-03 21:03:48 +02:00
|
|
|
const Breakpoint = ({ mobile, children }) => {
|
|
|
|
const className = mobile ? 'breakpoint-min-width-700' : 'breakpoint-max-width-700';
|
|
|
|
return (
|
|
|
|
<div className={className}>
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
2017-04-28 15:47:14 +10:00
|
|
|
|
|
|
|
Breakpoint.propTypes = {
|
2017-06-03 21:03:48 +02:00
|
|
|
children: PropTypes.array, // eslint-disable-line
|
2017-05-01 19:08:11 +10:00
|
|
|
mobile: PropTypes.bool,
|
2017-05-21 10:02:51 +02:00
|
|
|
};
|
2017-06-03 21:03:48 +02:00
|
|
|
Breakpoint.defaultProps = {
|
|
|
|
mobile: false,
|
|
|
|
};
|
2017-04-28 15:47:14 +10:00
|
|
|
|
2017-06-03 21:03:48 +02:00
|
|
|
export { Breakpoint as default };
|