diff --git a/src/components/layouts/header/Invitation.tsx b/src/components/layouts/header/Invitation.tsx index d2d0934..933bad0 100644 --- a/src/components/layouts/header/Invitation.tsx +++ b/src/components/layouts/header/Invitation.tsx @@ -297,11 +297,12 @@ const InvitationMenu = () => { maxHeight: "80vh", mt: "32px", position: "fixed", + display: "flex", + flexDirection: "column", }, }} > - - {/* Error and Success Alerts */} + {error && ( {error} @@ -315,21 +316,33 @@ const InvitationMenu = () => { - {/* Tabs */} setTabValue(newValue)} variant="fullWidth" - sx={{ mb: 2 }} + sx={{ + flexShrink: 0, + position: "sticky", + top: 0, + backgroundColor: "white", + zIndex: 1, + }} > + - {/* Sent Invitations */} - + {tabValue === 0 && ( - + {sentInvitations.length === 0 && ( {t("COHORTINVITATION.NO_PENDING_REQUESTS_SENT")} @@ -369,7 +382,7 @@ const InvitationMenu = () => { variant="outlined" sx={{ borderRadius: "15px" }} > - Revoke Invitation + Revoke @@ -378,10 +391,10 @@ const InvitationMenu = () => { ))} )} - {/* Received Invitations */} + {tabValue === 1 && ( - - {notificationCount === 0 && ( + + {receivedInvitations.length === 0 && ( {t("COHORTINVITATION.NO_PENDING_INVITATIONS")} @@ -452,6 +465,7 @@ const InvitationMenu = () => { )} + {/* Delete Confirmation Dialog */} setConfirmDelete(null)}> Delete Invitation diff --git a/src/pages/dashboard.tsx b/src/pages/dashboard.tsx index 0e34f9c..49e6a78 100644 --- a/src/pages/dashboard.tsx +++ b/src/pages/dashboard.tsx @@ -1,6 +1,6 @@ import { serverSideTranslations } from "next-i18next/serverSideTranslations"; import { useRouter } from "next/router"; -import { useEffect, useState, useMemo } from "react"; +import { useEffect, useState, useMemo, useRef } from "react"; interface RowData { tenantId?: string; @@ -10,8 +10,10 @@ interface RowData { const Dashboard = () => { const router = useRouter(); + const iframeRef = useRef(null); const [rowData, setRowData] = useState(); const [isError, setIsError] = useState(false); + const [iframeHeight, setIframeHeight] = useState("800px"); useEffect(() => { if (router.query) { @@ -42,6 +44,21 @@ const Dashboard = () => { return ""; }, [router.query.from, rowData]); + useEffect(() => { + const handleMessage = (event: MessageEvent) => { + if (event.origin !== process.env.NEXT_PUBLIC_METABASE_URL) return; + const newHeight = event.data?.height; + if (newHeight) { + setIframeHeight(`${newHeight}px`); + } + }; + + window.addEventListener("message", handleMessage); + return () => { + window.removeEventListener("message", handleMessage); + }; + }, []); + return (
{isError ? ( @@ -50,9 +67,10 @@ const Dashboard = () => {

) : (