From 0b606035593832c5cbd4ecbb846309d04159a276 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Fri, 31 Jan 2025 13:53:39 +0530 Subject: [PATCH] Fix duplicate backdrops --- .../Collections/CollectionShare.tsx | 115 +++++++++--------- 1 file changed, 55 insertions(+), 60 deletions(-) diff --git a/web/apps/photos/src/components/Collections/CollectionShare.tsx b/web/apps/photos/src/components/Collections/CollectionShare.tsx index d82f0feeb2..4c5da69a38 100644 --- a/web/apps/photos/src/components/Collections/CollectionShare.tsx +++ b/web/apps/photos/src/components/Collections/CollectionShare.tsx @@ -1,6 +1,9 @@ import { FocusVisibleButton } from "@/base/components/mui/FocusVisibleButton"; import { LoadingButton } from "@/base/components/mui/LoadingButton"; -import { SidebarDrawer } from "@/base/components/mui/SidebarDrawer"; +import { + NestedSidebarDrawer, + SidebarDrawer, +} from "@/base/components/mui/SidebarDrawer"; import { RowButton, RowButtonDivider, @@ -491,6 +494,11 @@ const AddParticipant: React.FC = ({ [emailList, collection.sharees], ); + const handleRootClose = () => { + onClose(); + onRootClose(); + }; + const collectionShare: AddParticipantFormProps["callback"] = async ({ email, emails, @@ -526,30 +534,21 @@ const AddParticipant: React.FC = ({ } }; - const handleRootClose = () => { - onClose(); - onRootClose(); - }; - - const handleDrawerClose: DialogProps["onClose"] = (_, reason) => { - if (reason == "backdropClick") { - handleRootClose(); - } else { - onClose(); - } - }; - return ( - + = ({ disableAutoFocus /> - + ); }; @@ -847,13 +846,6 @@ const ManageEmailShare: React.FC = ({ onClose(); onRootClose(); }; - const handleDrawerClose: DialogProps["onClose"] = (_, reason) => { - if (reason == "backdropClick") { - handleRootClose(); - } else { - onClose(); - } - }; const collectionUnshare = async (email: string) => { try { @@ -893,10 +885,10 @@ const ManageEmailShare: React.FC = ({ return ( <> - = ({ - + = ({ const { showMiniDialog } = useAppContext(); const galleryContext = useContext(GalleryContext); - const handleDrawerClose: DialogProps["onClose"] = (_, reason) => { - if (reason == "backdropClick") { - onRootClose(); - } else { - onClose(); - } + const handleRootClose = () => { + onClose(); + onRootClose(); }; const handleRemove = () => { @@ -1113,12 +1102,16 @@ const ManageParticipant: React.FC = ({ } return ( - + @@ -1185,7 +1178,7 @@ const ManageParticipant: React.FC = ({ - + ); }; @@ -1345,17 +1338,15 @@ const ManagePublicShareOptions: React.FC = ({ onRootClose, publicShareUrl, }) => { - const handleDrawerClose: DialogProps["onClose"] = (_, reason) => { - if (reason == "backdropClick") { - onRootClose(); - } else { - onClose(); - } - }; const galleryContext = useContext(GalleryContext); const [sharableLinkError, setSharableLinkError] = useState(null); + const handleRootClose = () => { + onClose(); + onRootClose(); + }; + const updatePublicShareURLHelper = async (req: UpdatePublicURL) => { try { galleryContext.setBlockingLoad(true); @@ -1383,16 +1374,22 @@ const ManagePublicShareOptions: React.FC = ({ galleryContext.setBlockingLoad(false); } }; + const copyToClipboardHelper = (text: string) => () => { navigator.clipboard.writeText(text); }; + return ( - + = ({ )} - + ); }; @@ -1563,7 +1560,7 @@ const ManageLinkExpiry: React.FC = ({ } /> - = ({ - + ); }; @@ -1663,12 +1660,9 @@ const ManageDeviceLimit: React.FC = ({ setIsChangeDeviceLimitVisible(false); }; - const handleDrawerClose: DialogProps["onClose"] = (_, reason) => { - if (reason == "backdropClick") { - onRootClose(); - } else { - closeDeviceLimitChangeModal(); - } + const handleRootClose = () => { + closeDeviceLimitChangeModal(); + onRootClose(); }; return ( @@ -1683,16 +1677,17 @@ const ManageDeviceLimit: React.FC = ({ onClick={openDeviceLimitChangeModalView} endIcon={} /> - @@ -1715,7 +1710,7 @@ const ManageDeviceLimit: React.FC = ({ - + ); };