Skip to content

Commit 7cc5ff9

Browse files
committed
fix: more icon unblocking
fixed iframe size for top menu mode
1 parent a242f21 commit 7cc5ff9

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

app/components/iframe/IframeContainer.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use client";
22

33
import { useIframeLifecycle, useUrlManager } from "@/app/lib/hooks/useIframe";
4+
import { useUserPreferences } from "@/app/lib/hooks/useUserPreferences";
45
import { getEffectiveUrl } from "@/app/lib/utils/iframe-utils";
56
import type { IframeContainerProps, IframeContainerRef, IframeUrl } from "@/app/types/iframe";
67
import { Box, useMediaQuery } from "@mui/material";
@@ -40,6 +41,21 @@ function getGlobalIframeContainer() {
4041
return globalIframeContainer;
4142
}
4243

44+
// Add a function to update container position based on menu position
45+
function updateGlobalContainerPosition(menuPosition: "top" | "side") {
46+
if (!globalIframeContainer) return;
47+
48+
if (menuPosition === "top") {
49+
globalIframeContainer.style.top = "64px"; // AppBar height
50+
globalIframeContainer.style.bottom = "0";
51+
globalIframeContainer.style.height = "auto";
52+
} else {
53+
globalIframeContainer.style.top = "0";
54+
globalIframeContainer.style.bottom = "0";
55+
globalIframeContainer.style.height = "100%";
56+
}
57+
}
58+
4359
// Individual iframe component
4460
function IframeElement({
4561
urlData,
@@ -199,6 +215,14 @@ const IframeContainer = forwardRef<IframeContainerRef, IframeContainerProps>(
199215
const containerRef = useRef<HTMLDivElement>(null);
200216
const isMobile = useMediaQuery("(max-width:600px)");
201217
const initialized = useRef(false);
218+
const { preferences } = useUserPreferences();
219+
220+
// Update container position when menu position changes
221+
useEffect(() => {
222+
if (preferences?.menuPosition) {
223+
updateGlobalContainerPosition(preferences.menuPosition);
224+
}
225+
}, [preferences?.menuPosition]);
202226

203227
// Initialize URLs on mount
204228
useEffect(() => {

middleware.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ interface JWTPayload {
2525
const isStaticAssetPath = (pathname: string) => {
2626
return (
2727
pathname.startsWith("/logos/") ||
28+
pathname.startsWith("/icons/") ||
2829
pathname.startsWith("/avatars/") ||
2930
pathname.startsWith("/public/") ||
3031
pathname === "/site.webmanifest" ||

0 commit comments

Comments
 (0)