From 22c12c68b5b1c60941d2b6e0e638cc6be2ca5916 Mon Sep 17 00:00:00 2001 From: Gaagul Gigi Date: Thu, 20 Jun 2024 16:03:52 +0530 Subject: [PATCH] Added option to pass data-cy to accordion --- src/components/Accordion/index.jsx | 2 ++ types/Accordion.d.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/components/Accordion/index.jsx b/src/components/Accordion/index.jsx index d366cf393..35e313298 100644 --- a/src/components/Accordion/index.jsx +++ b/src/components/Accordion/index.jsx @@ -17,6 +17,7 @@ const Accordion = ({ padded = false, style = ACCORDION_STYLES.primary, className = "", + ...otherProps }) => { const [openTab, setOpenTab] = useState(defaultActiveKey); @@ -32,6 +33,7 @@ const Accordion = ({ style === ACCORDION_STYLES.secondary, [className]: className, })} + {...otherProps} > {React.Children.map(children, (child, index) => { const isSingleOrLastChild = diff --git a/types/Accordion.d.ts b/types/Accordion.d.ts index 26e00f941..f41e75b46 100644 --- a/types/Accordion.d.ts +++ b/types/Accordion.d.ts @@ -5,6 +5,7 @@ export interface AccordionProps { defaultActiveKey?: number; padded?: boolean; style?: "primary" | "secondary"; + [key: string]: any; } export interface AccordionItemProps {