From 2cede3a46fb3d4f2049e1eff62ca8f3d451c76b7 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Thu, 10 Oct 2024 08:30:06 +0530 Subject: [PATCH] Reify --- .../src/components/AuthenticateUserModal.tsx | 4 +-- .../Collections/AlbumCastDialog.tsx | 2 +- .../Collections/CollectionNamer.tsx | 4 +-- .../src/components/DeleteAccountModal.tsx | 4 +-- .../src/components/ExportPendingList.tsx | 4 +-- .../FileInfo/FileNameEditDialog.tsx | 4 +-- web/packages/base/components/MiniDialog.tsx | 36 +++++++------------ 7 files changed, 19 insertions(+), 39 deletions(-) diff --git a/web/apps/photos/src/components/AuthenticateUserModal.tsx b/web/apps/photos/src/components/AuthenticateUserModal.tsx index e8d3c76626..0002760a82 100644 --- a/web/apps/photos/src/components/AuthenticateUserModal.tsx +++ b/web/apps/photos/src/components/AuthenticateUserModal.tsx @@ -102,9 +102,7 @@ export default function AuthenticateUserModal({ open={open} onClose={onClose} sx={{ position: "absolute" }} - attributes={{ - title: t("password"), - }} + title={t("password")} > = ({ {view == "choose" && ( diff --git a/web/apps/photos/src/components/Collections/CollectionNamer.tsx b/web/apps/photos/src/components/Collections/CollectionNamer.tsx index 7294b44ed6..0374b8dc14 100644 --- a/web/apps/photos/src/components/Collections/CollectionNamer.tsx +++ b/web/apps/photos/src/components/Collections/CollectionNamer.tsx @@ -42,9 +42,7 @@ export default function CollectionNamer({ attributes, ...props }: Props) { { open={open} onClose={onClose} fullScreen={isMobile} - attributes={{ - title: t("delete_account"), - }} + title={t("delete_account")} > initialValues={{ diff --git a/web/apps/photos/src/components/ExportPendingList.tsx b/web/apps/photos/src/components/ExportPendingList.tsx index 99690b2c61..667926afdd 100644 --- a/web/apps/photos/src/components/ExportPendingList.tsx +++ b/web/apps/photos/src/components/ExportPendingList.tsx @@ -62,9 +62,7 @@ const ExportPendingList = (props: Iprops) => { PaperProps={{ sx: { maxWidth: "444px" }, }} - attributes={{ - title: t("PENDING_ITEMS"), - }} + title={t("PENDING_ITEMS")} > & { onClose: () => void; - attributes?: DialogBoxV2Attributes; + /** + * The dialog's title. + * + * Usually this will be a string, but it can be any {@link ReactNode}. Note + * that it always gets wrapped in a Typography element to set the font + * style, so if your ReactNode wants to do its own thing, it'll need to + * reset or override these customizations. + */ + title?: React.ReactNode; } >; @@ -248,16 +244,12 @@ type DialogBoxV2Props = React.PropsWithChildren< * API for the notify/confirm case separately. */ export function DialogBoxV2({ - attributes, + title, children, open, onClose, ...props }: DialogBoxV2Props) { - if (!attributes) { - return <>; - } - const { PaperProps, ...rest } = props; return ( @@ -276,11 +268,9 @@ export function DialogBoxV2({ > - {attributes.title && ( - - {attributes.title} - - )} + + {title} + {children}