Skip to content

Instantly share code, notes, and snippets.

@hshoff
Created August 8, 2016 22:11
Show Gist options
  • Save hshoff/87bd6792abd3c320c70f5f8d6f71a7d5 to your computer and use it in GitHub Desktop.
Save hshoff/87bd6792abd3c320c70f5f8d6f71a7d5 to your computer and use it in GitHub Desktop.
Spacing
import React from 'react';
import cx from 'classnames';
export default function Spacing(Component) {
return (props) => {
const { spaceTop, spaceBottom } = props;
const classes = cx({
[`space-top-${spaceTop}`]: !!spaceTop,
[`space-${spaceBottom}`]: !!spaceBottom,
});
return (
<div className={classes}>
<Component {...props} />
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment