diff --git a/packages/extension/src/view/devtools/components/layout.tsx b/packages/extension/src/view/devtools/components/layout.tsx index f85a46a50..18ea0d6bf 100644 --- a/packages/extension/src/view/devtools/components/layout.tsx +++ b/packages/extension/src/view/devtools/components/layout.tsx @@ -29,6 +29,7 @@ import { CookieIconWhite, CookieIcon, InspectButton, + ToastMessage, } from '@ps-analysis-tool/design-system'; import { Resizable } from 're-resizable'; @@ -38,6 +39,7 @@ import { Resizable } from 're-resizable'; import Cookies from './cookies'; import useFrameOverlay from '../hooks/useFrameOverlay'; import { useCookieStore } from '../stateProviders/syncCookieStore'; +import { useSettingsStore } from '../stateProviders/syncSettingsStore'; interface LayoutProps { setSidebarData: React.Dispatch>; @@ -45,6 +47,16 @@ interface LayoutProps { const Layout = ({ setSidebarData }: LayoutProps) => { const [sidebarWidth, setSidebarWidth] = useState(200); + const mainRef = useRef(null); + const toastMessageRef = useRef(null); + + const { settingsChanged, handleSettingsChange } = useSettingsStore( + ({ state, actions }) => ({ + settingsChanged: state.settingsChanged, + handleSettingsChange: actions.handleSettingsChange, + }) + ); + const { tabFrames, frameHasCookies, @@ -190,7 +202,7 @@ const Layout = ({ setSidebarData }: LayoutProps) => { useFrameOverlay(filteredCookies, handleUpdate); return ( -
+
{ > -
-
{activePanel.element?.()}
+
{ + if (mainRef.current && toastMessageRef.current) { + toastMessageRef.current.style.bottom = + '-' + mainRef.current.scrollTop + 'px'; + } + }} + className="h-full flex-1 overflow-auto relative" + > +
{activePanel?.element()}
+ {settingsChanged && ( + + )}
);