Skip to content

Commit

Permalink
CounterLabel.js → CounterLabel.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
colebemis committed Feb 2, 2021
1 parent 62f0925 commit 042ce36
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/CounterLabel.js → src/CounterLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import PropTypes from 'prop-types'
import styled from 'styled-components'
import {COMMON, get} from './constants'
import {COMMON, get, SystemCommonProps} from './constants'
import sx, {SxProp} from './sx'
import theme from './theme'
import sx from './sx'
import {ComponentProps} from './utils/types'

const colorStyles = ({scheme, ...props}) => {
type StyledCounterLabelProps = {
scheme?: 'gray' | 'gray-light'
} & SystemCommonProps &
SxProp

const colorStyles = ({scheme, ...props}: StyledCounterLabelProps) => {
return {
color:
scheme === 'gray-light'
Expand All @@ -15,7 +21,7 @@ const colorStyles = ({scheme, ...props}) => {
}
}

const bgStyles = ({scheme, ...props}) => {
const bgStyles = ({scheme, ...props}: StyledCounterLabelProps) => {
return {
backgroundColor:
scheme === 'gray-light'
Expand All @@ -26,7 +32,7 @@ const bgStyles = ({scheme, ...props}) => {
}
}

const CounterLabel = styled.span`
const CounterLabel = styled.span<StyledCounterLabelProps>`
display: inline-block;
padding: 2px 5px;
font-size: ${get('fontSizes.0')};
Expand Down Expand Up @@ -56,4 +62,5 @@ CounterLabel.propTypes = {
...sx.propTypes
}

export type CounterLabelProps = ComponentProps<typeof CounterLabel>
export default CounterLabel
File renamed without changes.

0 comments on commit 042ce36

Please # to comment.