on 69dc015 help sign in
bridge/src/components/Spacing.js
32 lines 575 B history raw
1import React from 'react';
2import PropTypes from 'prop-types';
3import { isUndefined } from 'lodash';
6const Spacing = ({ className, children, h, w }) => {
8 const h_cn = isUndefined(h) ? '' : `mt-${h}`;
9 const w_cn = isUndefined(w) ? '' : `ml-${w}`;
11 return (
12 <div className={`${h_cn} ${w_cn} ${className}`}>
13 { children }
14 </div>
15 );
16};
18Spacing.propTypes = {
19 className: PropTypes.string,
20 children: PropTypes.node,
21 h: PropTypes.number,
22 w: PropTypes.number,
23};
25Spacing.defaultProps = {
26 className: '',
27 h: 0,
28 w: 0,
29};
32export default Spacing;