1
0
Pārlūkot izejas kodu

🍧 Fix ShareVideo modal problem (#4221)

* Fix ShareVideo modal problem

* Fix

* Revert modal transfer
WRadoslaw 1 gadu atpakaļ
vecāks
revīzija
a4440d9761

+ 8 - 1
packages/atlas/src/components/_video/VideoPlayer/VideoPlayer.tsx

@@ -717,7 +717,14 @@ const VideoPlayerComponent: ForwardRefRenderFunction<HTMLVideoElement, VideoPlay
       className={className}
       isSettingsPopoverOpened={isSettingsPopoverOpened}
     >
-      <div data-vjs-player onClick={() => handlePlayPause()}>
+      <div
+        data-vjs-player
+        onClick={() => {
+          if (!(isShareDialogOpen || isSharingOverlayOpen)) {
+            handlePlayPause()
+          }
+        }}
+      >
         {needsManualPlay && (
           <BigPlayButtonContainer
             onClick={() => {

+ 6 - 1
packages/atlas/src/components/_video/VideoPlayer/VideoShare.tsx

@@ -63,7 +63,12 @@ export const VideoShare: FC<VideoShareProps> = ({
   }
   if (!isEmbedded) {
     return (
-      <DialogModal title="Share video" show={isShareDialogOpen} onExitClick={onCloseShareDialog}>
+      <DialogModal
+        title="Share video"
+        show={isShareDialogOpen}
+        onClickOutside={onCloseShareDialog}
+        onExitClick={onCloseShareDialog}
+      >
         <VideoShareContent {...commonVideoShareContentProps} />
       </DialogModal>
     )