Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

refactor: Remove unused state and clean up RootLayout component

Salman-Ahamedfaeb06ff0904
diff --git a/packages/app/src/react/shared/components/layouts/RootLayout.tsx b/packages/app/src/react/shared/components/layouts/RootLayout.tsx
index 30cf8e37..79bf73a0 100644
--- a/packages/app/src/react/shared/components/layouts/RootLayout.tsx
+++ b/packages/app/src/react/shared/components/layouts/RootLayout.tsx
@@ -4,7 +4,7 @@ import { useAuthCtx } from '@react/shared/contexts/auth.context';
import { useOnboarding } from '@src/react/features/agents/contexts/OnboardingContext';
import OnboardingCompletedModal from '@src/react/features/onboarding/modals/OnboardingCompleted';
import classNames from 'classnames';
-import React, { Suspense, useEffect, useState } from 'react';
+import React, { Suspense, useEffect } from 'react';
import { TopbarPrimary } from './topbarPrimary/TopbarPrimary';
interface IRootLayoutProps {
@@ -34,7 +34,6 @@ export const RootLayout = ({
useFullWidthLayout = false,
} = layoutOptions;
const { loading } = useAuthCtx();
- const [hasScrollbar, setHasScrollbar] = useState<boolean>(false);
/**
* Checks if the main content has a scrollbar and adjusts the topbar width accordingly
@@ -57,7 +56,6 @@ export const RootLayout = ({
if (mainContent && topbar && topMenu) {
// Check if scrollbar is present by comparing scroll height to client height
const hasVerticalScrollbar = mainContent.scrollHeight > mainContent.clientHeight;
- setHasScrollbar(hasVerticalScrollbar);
// Adjust topbar width based on scrollbar presence
topbar.style.width = hasVerticalScrollbar ? 'calc(100% - 8px)' : '100%';