fix: Fixed 10080 settings sidebar scrolling issue (#10471)

* fix: #10080 settings sidebar scrolling issue

* fix: type error

Signed-off-by: Udit Takkar <[email protected]>

* Fixed type error

---------

Signed-off-by: Udit Takkar <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-07-31 18:51:08 +00:00
1 parent e93f1e2329
commit 12abca65b8
2 files changed
+45 -15

No files matched your search

+8 -4
View File
@@ -4,8 +4,8 @@ import dynamic from "next/dynamic";
import Link from "next/link";
import type { NextRouter } from "next/router";
import { useRouter } from "next/router";
import type { Dispatch, ReactNode, SetStateAction } from "react";
import React, { Fragment, useEffect, useState, useRef, useMemo } from "react";
import type { Dispatch, ReactNode, SetStateAction, ReactElement } from "react";
import React, { Fragment, useEffect, useState, useRef, useMemo, cloneElement } from "react";
import { Toaster } from "react-hot-toast";
import dayjs from "@calcom/dayjs";
@@ -218,7 +218,11 @@ const Layout = (props: LayoutProps) => {
<div className="flex min-h-screen flex-col">
<AppTop setBannersHeight={setBannersHeight} />
<div className="flex flex-1" data-testid="dashboard-shell">
{props.SidebarContainer || <SideBarContainer bannersHeight={bannersHeight} />}
{props.SidebarContainer ? (
cloneElement(props.SidebarContainer, { bannersHeight })
) : (
<SideBarContainer bannersHeight={bannersHeight} />
)}
<div className="flex w-0 flex-1 flex-col">
<MainContainer {...props} />
</div>
@@ -240,7 +244,7 @@ type LayoutProps = {
CTA?: ReactNode;
large?: boolean;
MobileNavigationContainer?: ReactNode;
SidebarContainer?: ReactNode;
SidebarContainer?: ReactElement;
TopNavContainer?: ReactNode;
drawerState?: DrawerState;
HeadingLeftIcon?: ReactNode;