docs: fix bug in layout change when using some chrome extensions (#13031)
This commit is contained in:
1 parent
9bb4c0306b
commit
ab65ddc0f1
2 files changed
+9
-6
No files matched your search
@@ -35,10 +35,11 @@ export const MainContentLayout = ({
|
|||||||
if (!isBrowser) {
|
if (!isBrowser) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
const rootLayout = document.getElementById("root-layout")
|
||||||
if (desktopSidebarOpen) {
|
if (desktopSidebarOpen) {
|
||||||
document.body.classList.add("lg:grid-cols-[221px_1fr]")
|
rootLayout?.classList.add("lg:grid-cols-[221px_1fr]")
|
||||||
} else {
|
} else {
|
||||||
document.body.classList.remove("lg:grid-cols-[221px_1fr]")
|
rootLayout?.classList.remove("lg:grid-cols-[221px_1fr]")
|
||||||
}
|
}
|
||||||
}, [desktopSidebarOpen, isBrowser])
|
}, [desktopSidebarOpen, isBrowser])
|
||||||
|
|
||||||
@@ -70,8 +71,7 @@ export const MainContentLayout = ({
|
|||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"pt-docs_4 lg:pt-docs_6 pb-docs_8 lg:pb-docs_4",
|
"pt-docs_4 lg:pt-docs_6 pb-docs_8 lg:pb-docs_4",
|
||||||
showContentMenu &&
|
showContentMenu && "grid grid-cols-1 lg:mx-auto",
|
||||||
"grid grid-cols-1 lg:mx-auto",
|
|
||||||
desktopSidebarOpen && "lg:grid-cols-[1fr_221px]",
|
desktopSidebarOpen && "lg:grid-cols-[1fr_221px]",
|
||||||
chatOpened && showCollapsedNavbar && "pl-docs_1",
|
chatOpened && showCollapsedNavbar && "pl-docs_1",
|
||||||
contentClassName
|
contentClassName
|
||||||
|
|||||||
@@ -19,14 +19,16 @@ export const RootLayout = ({
|
|||||||
...mainProps
|
...mainProps
|
||||||
}: RootLayoutProps) => {
|
}: RootLayoutProps) => {
|
||||||
return (
|
return (
|
||||||
<body
|
<body className={clsx("h-screen w-full overflow-hidden")}>
|
||||||
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"bg-medusa-bg-subtle font-base text-medium w-full",
|
"bg-medusa-bg-subtle font-base text-medium w-full",
|
||||||
"text-medusa-fg-base",
|
"text-medusa-fg-base",
|
||||||
"h-screen overflow-hidden",
|
"h-full overflow-hidden",
|
||||||
"grid grid-cols-1 lg:mx-auto lg:grid-cols-[221px_1fr]",
|
"grid grid-cols-1 lg:mx-auto lg:grid-cols-[221px_1fr]",
|
||||||
bodyClassName
|
bodyClassName
|
||||||
)}
|
)}
|
||||||
|
id="root-layout"
|
||||||
>
|
>
|
||||||
<RootProviders>
|
<RootProviders>
|
||||||
<ProvidersComponent>
|
<ProvidersComponent>
|
||||||
@@ -37,6 +39,7 @@ export const RootLayout = ({
|
|||||||
</div>
|
</div>
|
||||||
</ProvidersComponent>
|
</ProvidersComponent>
|
||||||
</RootProviders>
|
</RootProviders>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user