Skip to content

Commit

Permalink
refactor: improve collapsible region and versatile
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe committed Nov 1, 2024
1 parent d3aaf33 commit ff169ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ui/CollapsiblePanel/CollapsiblePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { ClickableSvg } from "../ClickableSvg/ClickableSvg";
type Props = React.HTMLProps<HTMLDivElement> & {
Header: React.ReactNode;
children: React.ReactNode;
isClosed?: boolean;
childrenClassName?: string;
dataCount?: number;
isCollapsed?: boolean;
onCollapsedStateChange?: (isClosed: boolean) => void;
iconClassName?: string;
};

export default function CollapsiblePanel({
Expand All @@ -22,6 +22,7 @@ export default function CollapsiblePanel({
childrenClassName = "overflow-y-auto",
dataCount,
onCollapsedStateChange = () => {},
iconClassName = "h-6 w-6",
...props
}: Props) {
const [isOpen, setIsOpen] = useState(!isCollapsed);
Expand Down Expand Up @@ -57,7 +58,7 @@ export default function CollapsiblePanel({
"rotate-180": !isOpen
})}
>
<IoChevronUpOutline className="h-6 w-6" />
<IoChevronUpOutline className={iconClassName} />
</ClickableSvg>
</div>
</div>
Expand Down

0 comments on commit ff169ac

Please sign in to comment.