Created
September 26, 2017 14:54
-
-
Save aaronmcadam/5823f519a21922ab890f4b4cca79cfc9 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
import React from 'react'; | |
import styled, { css } from 'styled-components'; | |
import { baseTheme, getFont } from '@crowdlab/themes'; | |
import { getFontSize } from './helpers'; | |
const HeadingBase = styled.h1` | |
font-family: ${getFont('bold')}; | |
font-weight: 500; | |
font-size: ${getFontSize}; | |
margin: 0; | |
margin-top: 1rem; | |
margin-bottom: 1rem; | |
`; | |
const Heading = ({ level, ...props }) => { | |
const Component = HeadingBase.withComponent(`h${level}`); | |
return <Component {...props} />; | |
}; | |
Heading.defaultProps = { | |
level: 1, | |
theme: baseTheme, | |
}; | |
export default Heading; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment