mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-23 05:02:10 +08:00
31 lines
558 B
JavaScript
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;
|