Skip to content

Commit

Permalink
chore(docs): Disable TOCs in dev mode and use temporary layout
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaursen committed Jan 18, 2022
1 parent 78b7396 commit 3203af4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions packages/documentation/src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ const icons: ConfiguredIcons = {

let devLayoutConf: LayoutConfiguration | undefined;
if (process.env.NODE_ENV !== "production") {
// devLayoutConf = {
// landscapeTabletLayout: "temporary",
// desktopLayout: "temporary",
// largeDesktopLayout: "temporary",
// };
devLayoutConf = {
landscapeTabletLayout: "temporary",
desktopLayout: "temporary",
largeDesktopLayout: "temporary",
};
}

export default function Layout({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ export function TOCVisibilityProvider({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isLargeDesktop]);

const rendered = !!tocs[pathname]?.length;
// I get SSR errors in dev mode since I normally have the dev tools open which
// results in different app sizes
const rendered =
!!tocs[pathname]?.length && process.env.NODE_ENV === "production";
const actions = useMemo(() => ({ show, hide, toggle }), [hide, show, toggle]);
const visibility = useMemo(
() => ({
Expand Down

0 comments on commit 3203af4

Please sign in to comment.