Skip to content

Instantly share code, notes, and snippets.

@hshoff

hshoff/space.js

Created Aug 8, 2016
Embed
What would you like to do?
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
You can’t perform that action at this time.