Skip to content

Commit ed50c7e

Browse files
authored
Merge pull request #1036 from primer/cb/ts-circle-octicon
Migrate CircleOcticon to TypeScript
2 parents b6eb246 + 058e791 commit ed50c7e

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

.changeset/quiet-lobsters-sing.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/components": patch
3+
---
4+
5+
Migrate `CircleOcticon` to TypeScript

src/CircleOcticon.js renamed to src/CircleOcticon.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
3-
import Flex from './Flex'
3+
import Flex, {FlexProps} from './Flex'
44
import theme from './theme'
55
import BorderBox from './BorderBox'
6+
import {IconProps} from '@primer/octicons-react'
67

7-
function CircleOcticon(props) {
8+
export type CircleOcticonProps = {
9+
as?: React.ElementType
10+
size?: number
11+
icon: React.ComponentType<{size?: IconProps['size']}>
12+
} & FlexProps
13+
14+
function CircleOcticon(props: CircleOcticonProps) {
815
const {size, as} = props
9-
const {icon: IconComponent, bg, as: asProp, ...rest} = props
16+
const {icon: IconComponent, bg, ...rest} = props
1017
return (
1118
<BorderBox as={as} bg={bg} overflow="hidden" borderWidth={0} size={size} borderRadius="50%">
1219
<Flex {...rest} alignItems="center" justifyContent="center">
File renamed without changes.

0 commit comments

Comments
 (0)