Skip to content

Commit 1bcf3aa

Browse files
refactor(pill): update props to accept incoming Chakra props
1 parent d9b29a1 commit 1bcf3aa

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/components/Pill.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react"
2-
import { Flex } from "@chakra-ui/react"
2+
import { Flex, FlexProps } from "@chakra-ui/react"
33

4-
export interface IProps {
4+
export interface IProps extends FlexProps {
55
children?: React.ReactNode
66
className?: string
77
isSecondary?: boolean
@@ -12,7 +12,8 @@ const Pill: React.FC<IProps> = ({
1212
children,
1313
className,
1414
isSecondary,
15-
color,
15+
background,
16+
...rest
1617
}) => {
1718
return isSecondary ? (
1819
<Flex
@@ -28,12 +29,13 @@ const Pill: React.FC<IProps> = ({
2829
borderRadius="base"
2930
fontSize="xs"
3031
className={className}
32+
{...rest}
3133
>
3234
{children}
3335
</Flex>
3436
) : (
3537
<Flex
36-
backgroundColor={color ? color : "primary100"}
38+
background={background ?? "primary100"}
3739
display="inline-block"
3840
color="black300"
3941
textTransform="uppercase"
@@ -44,6 +46,7 @@ const Pill: React.FC<IProps> = ({
4446
fontSize="xs"
4547
borderRadius="base"
4648
className={className}
49+
{...rest}
4750
>
4851
{children}
4952
</Flex>

0 commit comments

Comments
 (0)