Created
October 19, 2017 14:33
-
-
Save jaredpalmer/4d4fa293f3f6d8351a5e7975b22b5a51 to your computer and use it in GitHub Desktop.
glamor-jsxstyle dirty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { css as Style } from 'glamor'; | |
const View = ({ | |
component = 'div', | |
props, | |
css, | |
className, | |
children, | |
...rest, | |
}) => { | |
return React.createElement( | |
component, | |
{ ...props, className, ...Style({ ...rest, ...css }) }, | |
children | |
); | |
}; | |
export const Block = props => ( | |
<View display="block" {...props} /> | |
); | |
export const InlineBlock = props => ( | |
<View display="inline-block" {...props} /> | |
); | |
export const Inline = props => ( | |
<View display="inline" {...props} /> | |
); | |
export const Flex = props => ( | |
<View display="flex" {...props} /> | |
); | |
export const InlineFlex = props => ( | |
<View display="inline-flex" {...props} /> | |
); | |
export const Row = props => ( | |
<Flex flexDirection="row" {...props} /> | |
); | |
export const Col = props => ( | |
<Flex flexDirection="column" {...props} /> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment