Skip to content

Commit

Permalink
Migrate CircleOcticon to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
colebemis committed Feb 9, 2021
1 parent b6eb246 commit 1dda5ff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/CircleOcticon.js → src/CircleOcticon.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import React from 'react'
import PropTypes from 'prop-types'
import Flex from './Flex'
import Flex, {FlexProps} from './Flex'
import theme from './theme'
import BorderBox from './BorderBox'
import {IconProps} from '@primer/octicons-react'

function CircleOcticon(props) {
export type CircleOcticonProps = {
as?: React.ElementType
size?: number
icon: React.ComponentType<{size?: IconProps['size']}>
} & FlexProps

function CircleOcticon(props: CircleOcticonProps) {
const {size, as} = props
const {icon: IconComponent, bg, as: asProp, ...rest} = props
const {icon: IconComponent, bg, ...rest} = props
return (
<BorderBox as={as} bg={bg} overflow="hidden" borderWidth={0} size={size} borderRadius="50%">
<Flex {...rest} alignItems="center" justifyContent="center">
Expand Down
File renamed without changes.

0 comments on commit 1dda5ff

Please # to comment.