Created
March 2, 2019 14:18
-
-
Save kamleshchandnani/e72796c66d0b7194a97511ff214415b3 to your computer and use it in GitHub Desktop.
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
const Link = styled( | |
({ | |
color, // spread out props and don't pass them down | |
children, | |
...props | |
}) => ( | |
<a {...props}> | |
{children} | |
</a> | |
), | |
)` | |
color: ${styles.color}; | |
text-decoration: none; | |
cursor: pointer; | |
pointer-events: ${styles.pointerEvents}; | |
&:hover { | |
color: ${styles.hover.color}; | |
} | |
&:focus { | |
outline: none; | |
text-decoration: underline; | |
color: ${styles.focus.color}; | |
} | |
`; | |
Link.defaultProps = { | |
color: 'blue', | |
}; | |
export default Link; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment