From 9e919ea761f0d947247025b563e7682c2a241680 Mon Sep 17 00:00:00 2001 From: Gigiaj Date: Thu, 8 May 2025 17:56:49 -0500 Subject: [PATCH] prepare to feed this to child elements for visibility handling --- .../pages/call/PersistentCallContainer.tsx | 142 +++++++----------- 1 file changed, 53 insertions(+), 89 deletions(-) diff --git a/src/app/pages/call/PersistentCallContainer.tsx b/src/app/pages/call/PersistentCallContainer.tsx index f244150e..567a72ea 100644 --- a/src/app/pages/call/PersistentCallContainer.tsx +++ b/src/app/pages/call/PersistentCallContainer.tsx @@ -28,7 +28,16 @@ interface PersistentCallContainerProps { viewedRoomId: string; } -export function PersistentCallContainer({ isVisible, viewedRoomId }: PersistentCallContainerProps) { +export function PersistentCallContainer({ + isVisible, + viewedRoomId, + iframeRef, + widgetApiRef, + smallWidgetRef, + backupIframeRef, + backupWidgetApiRef, + backupSmallWidgetRef, +}: PersistentCallContainerProps) { const { activeCallRoomId, isChatOpen, @@ -51,14 +60,6 @@ export function PersistentCallContainer({ isVisible, viewedRoomId }: PersistentC logger.info(room); - const iframeRef = useRef(null); - const widgetApiRef = useRef(null); - const smallWidgetRef = useRef(null); - - const backupIframeRef = useRef(null); - const backupWidgetApiRef = useRef(null); - const backupSmallWidgetRef = useRef(null); - const setupWidget = (widgetApiRef, smallWidgetRef, iframeRef, skipLobby) => { const cleanupRoomId = smallWidgetRef.current?.roomId; logger.debug(`PersistentCallContainer effect running. activeCallRoomId: ${activeCallRoomId}`); @@ -171,95 +172,58 @@ export function PersistentCallContainer({ isVisible, viewedRoomId }: PersistentC }; return ( - - - {activeCallRoomId && roomId && room !== null && ( - - - - - - } - /> - - - )} - + + - {activeCallRoomId && roomId && room !== null && ( - - - - - - )} - -