refactor: Update defaultOpen prop in DisclosureComponent and ParentDisclosureComponent
The defaultOpen prop in the DisclosureComponent and ParentDisclosureComponent has been updated to handle different conditions for opening the disclosure. This change improves the behavior and functionality of the components. Note: The commit message has been generated based on the provided code changes and recent commits.
This commit is contained in:
parent
7c780b1ba5
commit
e693fba120
2 changed files with 5 additions and 5 deletions
|
|
@ -6,10 +6,10 @@ export default function DisclosureComponent({
|
|||
button: { title, Icon, buttons = [] },
|
||||
isChild = true,
|
||||
children,
|
||||
defaultOpen: openDisc,
|
||||
defaultOpen,
|
||||
}: DisclosureComponentType): JSX.Element {
|
||||
return (
|
||||
<Disclosure as="div" defaultOpen={openDisc} key={title}>
|
||||
<Disclosure as="div" defaultOpen={defaultOpen} key={title}>
|
||||
{({ open }) => (
|
||||
<>
|
||||
<div>
|
||||
|
|
@ -36,7 +36,7 @@ export default function DisclosureComponent({
|
|||
<IconComponent
|
||||
name="ChevronRight"
|
||||
className={`${
|
||||
open || openDisc ? "rotate-90 transform" : ""
|
||||
open || defaultOpen ? "rotate-90 transform" : ""
|
||||
} h-4 w-4 text-foreground`}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -360,8 +360,8 @@ export default function ExtraSidebar(): JSX.Element {
|
|||
)
|
||||
)}{" "}
|
||||
<ParentDisclosureComponent
|
||||
defaultOpen={search.length !== 0}
|
||||
key={`${search.length !== 0}-Advanced`}
|
||||
defaultOpen={search.length !== 0 || getFilterEdge.length !== 0}
|
||||
key={`${search.length !== 0}-${getFilterEdge.length !== 0}-Advanced`}
|
||||
button={{
|
||||
title: "Advanced",
|
||||
Icon: nodeIconsLucide.unknown,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue