Skip to content

Commit

Permalink
🔥 Remove double type declaration #1378
Browse files Browse the repository at this point in the history
  • Loading branch information
millianapia committed Jan 3, 2023
1 parent 13c4fff commit 7bfc77a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion web/components/src/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ export type AccordionProps = RAccordionProps & {
id: string
children?: React.ReactNode
}

// TODO: Remove or change how IDs are sent as prop in tests
export type CAccordionProps = {
id: string
children?: React.ReactNode
} & ChakraAccordionProps

export const Accordion = Flags.IS_DEV
Expand Down
1 change: 0 additions & 1 deletion web/components/src/Accordion/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export type AccordionHeaderProps = {

export type CAccordionHeaderProps = {
headingLevel?: 'h2' | 'h3' | 'h4' | 'h5'
children: React.ReactNode
} & ChakraAccordionButtonProps

const StyledCAccordionButton = styled(CAccordionButton)`
Expand Down
3 changes: 2 additions & 1 deletion web/components/src/Accordion/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ export type AccordionItemProps = RAccordionItemProps & {
id: number
}

// TODO: refactor tests so we can remove the children type here
export type CAccordionItemProps = {
id: number
children: React.ReactNode
children: React.ReactNode
}

export const Item = Flags.IS_DEV
Expand Down
2 changes: 1 addition & 1 deletion web/components/src/Accordion/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export type AccordionPanelProps = {
} & RAccordionPanelProps

export type CAccordionPanelProps = {
children?: React.ReactNode
animate?: boolean
} & ChakraAccordionPanelProps

Expand All @@ -34,6 +33,7 @@ const ContentWithBorder = styled.div`
padding-left: calc(var(--space-xLarge) / 2);
`

// TODO: Remove animate prop, as it is not needed on chakra components
export const Panel = Flags.IS_DEV
? forwardRef<HTMLDivElement, CAccordionPanelProps>(function Panel(
{ children, animate = true, ...rest },
Expand Down

0 comments on commit 7bfc77a

Please sign in to comment.