Skip to content

Commit 302e9ca

Browse files
authored
Merge pull request #63 from cbassuarez/codex/fix-global-scroll-behavior-for-viewer-hccxs2
2 parents 6920798 + 20b8d3e commit 302e9ca

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

web/src/index.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ body {
7474
overflow-y: auto;
7575
}
7676

77+
body.viewer-route {
78+
overflow: hidden;
79+
}
80+
7781
.phase-resolution-slider-wrapper {
7882
--ps-res-track-height: 0.85rem;
7983
--ps-res-thumb-size: 0.9rem;

web/src/layouts/AppLayout.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import React, { useEffect } from "react";
22
import { useLocation } from "react-router-dom";
33
import clsx from "clsx";
44
import TopBar from "../components/TopBar";
@@ -15,6 +15,18 @@ export const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
1515
location.pathname === basePath ||
1616
location.pathname === `${basePath}/`;
1717

18+
useEffect(() => {
19+
if (isViewer) {
20+
document.body.classList.add("viewer-route");
21+
} else {
22+
document.body.classList.remove("viewer-route");
23+
}
24+
25+
return () => {
26+
document.body.classList.remove("viewer-route");
27+
};
28+
}, [isViewer]);
29+
1830
const rootClass = clsx(
1931
// base shell
2032
"flex min-h-screen flex-col bg-slate-50 text-slate-900",

0 commit comments

Comments
 (0)