Created
March 23, 2018 11:59
-
-
Save antoinejaussoin/3332d6917e98850d8da8b31838688ac7 to your computer and use it in GitHub Desktop.
Card Component rewritten with Styled Components
This file contains 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 styled from 'styled-components'; | |
const Container = styled.div` | |
display: flex; | |
width: 100px; | |
height: 150px; | |
border: 3px solid ${props => props.color}; | |
border-radius: 15px; | |
justify-content: space-around; | |
font-size: 5em; | |
color: ${props => props.color}; | |
`; | |
const Content = styled.div` | |
align-self: center; | |
`; | |
const Card = ({ children, color = '#ff867c' }) => ( | |
<Container color={color}> | |
<Content> | |
{children} | |
</Content> | |
</Container> | |
); | |
export default Card; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment