Skip to content
This repository was archived by the owner on Aug 31, 2022. It is now read-only.

Commit f297fc1

Browse files
committed
fix: update Accordion props and styles
1 parent 4cea3d1 commit f297fc1

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/components/Accordion/Accordion.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import clsx from 'clsx';
22
import { Card, CardVariant } from 'components/Card/Card';
3+
import { Icon } from 'components/Icon/Icon';
4+
import { IconButton } from 'components/IconButton/IconButton';
35
import { ArrowDropdownDownIcon } from 'components/Icons/ArrowDropdownDownIcon';
46
import { useRef, useState } from 'react';
57
import { CSSTransition } from 'react-transition-group';
@@ -8,6 +10,7 @@ export interface AccordionProps {
810
flat?: boolean;
911
title: React.ReactNode;
1012
className?: string;
13+
wrapperClassName?: string;
1114
children?: React.ReactNode;
1215
variant?: CardVariant;
1316
}
@@ -17,15 +20,16 @@ export const Accordion: React.FC<AccordionProps> = ({
1720
title,
1821
children,
1922
className,
20-
variant
23+
variant,
24+
wrapperClassName = ''
2125
}) => {
2226
const [isActive, setIsActive] = useState(false);
2327

2428
const toggleIsActive = () => setIsActive((previous) => !previous);
2529

2630
const nodeRef = useRef(null);
2731
return (
28-
<Card className={className} variant={variant}>
32+
<Card className={className} variant={variant} wrapperClassName={wrapperClassName}>
2933
<div
3034
className={clsx('ui-flex ui-justify-between ui-items-center ui-select-none', {
3135
'ui-cursor-default': flat
@@ -37,14 +41,14 @@ export const Accordion: React.FC<AccordionProps> = ({
3741
>
3842
<h3 className='ui-tg-body'>{title}</h3>
3943
{!flat && (
40-
<ArrowDropdownDownIcon
41-
className={clsx(
42-
'ui-transition-transform ui-text-black-600 dark:ui-text-white ui-text-base',
43-
{
44+
<IconButton rounded size='sm'>
45+
<Icon
46+
className={clsx('ui-transition-transform ui-text-primary ui-text-base', {
4447
'ui-transform ui-rotate-180 ': isActive
45-
}
46-
)}
47-
/>
48+
})}
49+
name='Bottom-3'
50+
/>
51+
</IconButton>
4852
)}
4953
</div>
5054
{/* TODO: update the transition package */}

0 commit comments

Comments
 (0)