/* * based on * github.com/roylee0704/react-flexbox-grid/blob/master/src/components/Col.js */ const flatten = require('lodash.flatten'); const classNames = require('classnames'); const React = require('react'); const styles = require('./style.css'); const breakpoints = [ 'xs', 'sm', 'md', 'lg' ]; const getClasses = (props) => { return flatten(breakpoints.map((size) => { const number = props[size]; const offset = props[`${size}Offset`]; return [ number ? styles[`${size}-${number}`] : '', offset ? styles[`${size}-offset-${offset}`] : '' ]; })).filter(Boolean); }; const Column = (props) => { const { children, className, reverse, style } = props; const cn = classNames( className, styles.column, reverse ? styles.reverse : '', ...getClasses(props) ); return (