[WEB-1134] fix: module link mutation issue (#4413)

* fix module link mutation issue

* reference moduleDetails?.link_module inside a prop of Disclosure instead of in a div
This commit is contained in:
rahulramesha 2024-05-09 16:49:24 +05:30 committed by GitHub
parent 11cd9f57d7
commit 692f570258
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -644,7 +644,8 @@ export const ModuleDetailsSidebar: React.FC<Props> = observer((props) => {
</div>
<div className="flex w-full flex-col items-center justify-start gap-2 border-t border-custom-border-200 px-1.5 py-5">
<Disclosure>
{/* Accessing link outside the disclosure as mobx is not considering the children inside Disclosure as part of the component hence not observing their state change*/}
<Disclosure defaultOpen={!!moduleDetails?.link_module?.length}>
{({ open }) => (
<div className={`relative flex h-full w-full flex-col ${open ? "" : "flex-row"}`}>
<Disclosure.Button className="flex w-full items-center justify-between gap-2 p-1.5">