Created
June 6, 2019 05:29
-
-
Save DubiousS/ce8df4453ec668dd71690bc76867df76 to your computer and use it in GitHub Desktop.
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
export default class Card extends Component { | |
static Top = ({ children, ...props }) => ( | |
<Box px={25} position="absolute" top="-20px" left="0" zIndex="1" {...props}> | |
{children} | |
</Box> | |
) | |
static Main = ({ children, ...props }) => ( | |
<Box {...props}>{children}</Box> | |
) | |
render() { | |
return ( | |
<RoundedBox position="relative" {...this.props}> | |
{this.props.children} | |
</RoundedBox> | |
) | |
} | |
const Test = () => ( | |
<Card> | |
<Card.Top>Header</Card.Top> | |
<Card.Main> | |
<AnyComponent /> | |
</Card.Main> | |
</Card> | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment