Skip to content

Instantly share code, notes, and snippets.

@mlshv
Last active September 24, 2019 10:49
Show Gist options
  • Save mlshv/3b84d82641eaf4affc015d5819d75503 to your computer and use it in GitHub Desktop.
Save mlshv/3b84d82641eaf4affc015d5819d75503 to your computer and use it in GitHub Desktop.
sc override with classes
import React from 'react'
import styled from 'styled-components'
import Icon from 'components/Icon'
const ButtonWrap = styled.button`
padding: 8px 12px;
color: #fff;
background: #333;
`
const ButtonIcon = styled(Icon)`
line-height: 1;
`
const Button = ({ classes, icon, children }) => {
return (
<ButtonWrap className={classes.button}>
{icon ? (
<ButtonIcon
name={icon}
className={classes.icon}
/>
) : (
null
)}
{children}
</ButtonWrap>
)
}
export default Button
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment