Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Migrate Text to TypeScript #979

Merged
merged 6 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cool-snakes-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/components": patch
---

Migrate `Text` to TypeScript
9 changes: 5 additions & 4 deletions src/Text.js → src/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import styled from 'styled-components'
import PropTypes from 'prop-types'
import styled from 'styled-components'
import {COMMON, SystemCommonProps, SystemTypographyProps, TYPOGRAPHY} from './constants'
import sx, {SxProp} from './sx'
import theme from './theme'
import {TYPOGRAPHY, COMMON} from './constants'
import sx from './sx'

const Text = styled.span`
const Text = styled.span<SystemTypographyProps & SystemCommonProps & SxProp>`
${TYPOGRAPHY};
${COMMON};
${sx};
Expand All @@ -21,4 +21,5 @@ Text.propTypes = {
theme: PropTypes.object
}

export type TextProps = React.ComponentProps<typeof Text>
export default Text
File renamed without changes.