storybook/docs/components/Breakpoint.js
2017-05-26 00:46:23 +02:00

31 lines
558 B
JavaScript

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './breakpoints.css';
class Breakpoint extends Component {
render() {
const { mobile, children } = this.props;
if (mobile) {
return (
<div className="breakpoint-min-width-700">
{children}
</div>
);
}
return (
<div className="breakpoint-max-width-700">
{children}
</div>
);
}
}
Breakpoint.propTypes = {
children: PropTypes.array,
mobile: PropTypes.bool,
};
export default Breakpoint;