From 9bc75e2e4004e7871563daf9822c2d0f40825b66 Mon Sep 17 00:00:00 2001 From: Lowell Torola <44183219+lowtorola@users.noreply.github.com> Date: Sun, 12 Jan 2025 02:21:53 +0400 Subject: [PATCH] fix client size and add scrim types (#901) --- frontend/src/components/ResponsiveIframe.tsx | 13 ++++++++++--- .../components/tables/scrimmaging/InboxTable.tsx | 5 +++++ .../components/tables/scrimmaging/OutboxTable.tsx | 5 +++++ frontend/src/views/Client.tsx | 6 +++--- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/ResponsiveIframe.tsx b/frontend/src/components/ResponsiveIframe.tsx index 11e89480a..0f14d8dde 100644 --- a/frontend/src/components/ResponsiveIframe.tsx +++ b/frontend/src/components/ResponsiveIframe.tsx @@ -4,9 +4,13 @@ import { isPresent } from "utils/utilTypes"; interface ResponsiveIframeProps { url: string; + className?: string; } -const ResponsiveIframe: React.FC = ({ url }) => { +const ResponsiveIframe: React.FC = ({ + url, + className = "", +}) => { const containerRef = useRef(null); const [dimensions, setDimensions] = useState({ width: "100%", @@ -27,10 +31,13 @@ const ResponsiveIframe: React.FC = ({ url }) => { return () => { window.removeEventListener("resize", updateDimensions); }; - }, []); + }, [ + containerRef.current?.getBoundingClientRect().width, + containerRef.current?.getBoundingClientRect().height, + ]); return ( -
+