Skip to content

Commit 67ea540

Browse files
authored
feat: allow customizable container in ModalComponent for modal rendering and show end screen sharing warning only on detached window [WPB-17002] (#19943)
* feat: allow customizable container in ModalComponent for modal rendering * feat: add condition to show end screen sharing in detached mode only
1 parent 401f92b commit 67ea540

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/script/components/Modals/ModalComponent/ModalComponent.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ interface ModalComponentProps extends HTMLProps<HTMLDivElement> {
4444
onClosed?: () => void;
4545
showLoading?: boolean;
4646
wrapperCSS?: CSSObject;
47+
container?: Element | DocumentFragment;
4748
}
4849

4950
const CLOSE_DELAY = 350;
@@ -56,6 +57,7 @@ const ModalComponent = ({
5657
onClosed = noop,
5758
showLoading = false,
5859
wrapperCSS,
60+
container,
5961
children,
6062
onKeyDown,
6163
...rest
@@ -134,7 +136,7 @@ const ModalComponent = ({
134136
</div>
135137
)}
136138
</div>,
137-
document.body,
139+
container || document.body,
138140
)}
139141
</>
140142
);

src/script/components/calling/FullscreenVideoCall.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ const FullscreenVideoCall = ({
177177

178178
const hasAlreadyConfirmed = localStorage.getItem(LOCAL_STORAGE_KEY_FOR_SCREEN_SHARING_CONFIRM_MODAL) === 'true';
179179

180-
if (isSharingScreen && isScreenSharingSourceFromDetachedWindow && !hasAlreadyConfirmed) {
180+
const isDetachedWindow = viewMode === CallingViewMode.DETACHED_WINDOW;
181+
182+
if (isSharingScreen && isScreenSharingSourceFromDetachedWindow && isDetachedWindow && !hasAlreadyConfirmed) {
181183
setIsConfirmCloseModalOpen(true);
182184
return;
183185
}
@@ -457,6 +459,9 @@ const FullscreenVideoCall = ({
457459
onBgClick={() => setIsConfirmCloseModalOpen(false)}
458460
data-uie-name="confirm-close-with-active-screen-share-modal"
459461
wrapperCSS={{borderRadius: 10, width: 328}}
462+
container={
463+
viewMode === CallingViewMode.DETACHED_WINDOW && detachedWindow ? detachedWindow.document.body : undefined
464+
}
460465
>
461466
{isConfirmCloseModalOpen && (
462467
<>

0 commit comments

Comments
 (0)