From 26af5680e7a1990dfff6b68c20cfbd172bcff750 Mon Sep 17 00:00:00 2001 From: Hugh Nimmo-Smith Date: Fri, 9 May 2025 11:07:35 +0100 Subject: [PATCH] Tidy up --- crates/data-model/src/site_config.rs | 2 +- frontend/src/routes/_account.plan.index.tsx | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/crates/data-model/src/site_config.rs b/crates/data-model/src/site_config.rs index 2d22b3f06..b59d0f075 100644 --- a/crates/data-model/src/site_config.rs +++ b/crates/data-model/src/site_config.rs @@ -90,7 +90,7 @@ pub struct SiteConfig { /// Whether users can log in with their email address. pub login_with_email_allowed: bool, - + /// The iframe URL to show in the plan tab of the UI pub plan_management_iframe_uri: Option, } diff --git a/frontend/src/routes/_account.plan.index.tsx b/frontend/src/routes/_account.plan.index.tsx index 7f0e17994..c2a5c1626 100644 --- a/frontend/src/routes/_account.plan.index.tsx +++ b/frontend/src/routes/_account.plan.index.tsx @@ -43,37 +43,37 @@ function Plan(): React.ReactElement { } const ref = useRef(null); - const [height, setHeight] = useState("0px"); + const [iframeHeight, setIframeHeight] = useState("0px"); // Poll the size of the iframe content and set the height // This will only work where the iframe is served from the same origin - const doHeight = useCallback(() => { + const calculateHeight = useCallback(() => { const height = ref.current?.contentWindow?.document.body.parentElement?.scrollHeight; if (height) { - setHeight(`${height}px`); + setIframeHeight(`${height}px`); } else { - setHeight("500px"); + setIframeHeight("500px"); } }, []); useEffect(() => { - doHeight(); + calculateHeight(); const interval = setInterval(() => { - doHeight(); + calculateHeight(); }, 1000); return () => clearInterval(interval); - }, [doHeight]); + }, [calculateHeight]); return (