From 7dc24a64ced4e8c05e7a93afebfffb8973d10d5d Mon Sep 17 00:00:00 2001 From: shivam-kumar-ts Date: Mon, 8 Sep 2025 12:00:21 +0530 Subject: [PATCH] Revert "SCAL-213939 Update document body width to account for sidebar space" --- src/components/DevDocTemplate/index.tsx | 6 +----- src/components/LeftSidebar/index.tsx | 4 +--- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/DevDocTemplate/index.tsx b/src/components/DevDocTemplate/index.tsx index c7cf03cd9..b74626fe5 100644 --- a/src/components/DevDocTemplate/index.tsx +++ b/src/components/DevDocTemplate/index.tsx @@ -63,11 +63,7 @@ const DevDocTemplate: FC = (props) => { const isHomePage = curPageNode?.pageAttributes?.pageid === HOME_PAGE_ID; - // use window.innerWidth if window is defined else use useResizeDetector width - const { - width = isBrowser() ? window?.innerWidth : 0, - ref, - } = useResizeDetector(); + const { width, ref } = useResizeDetector(); const [params, setParams] = useState({ [TS_HOST_PARAM]: DEFAULT_HOST, [TS_ORIGIN_PARAM]: '', diff --git a/src/components/LeftSidebar/index.tsx b/src/components/LeftSidebar/index.tsx index 531b733d9..8bbcce42c 100644 --- a/src/components/LeftSidebar/index.tsx +++ b/src/components/LeftSidebar/index.tsx @@ -71,9 +71,7 @@ const LeftSideBar = (props: { }, [params[NAV_PREFIX], params[TS_PAGE_ID_PARAM], props.navContent]); useEffect(() => { - if (ref?.current?.offsetWidth) { - props.handleLeftNavChange(ref?.current?.offsetWidth); - } + props.handleLeftNavChange(ref?.current?.offsetWidth); }, [width]); const toggleExpandOnTab = (text: string) => {