This commit is contained in:
Manav Rathi
2024-10-10 08:30:06 +05:30
parent ceed538181
commit 2cede3a46f
7 changed files with 19 additions and 39 deletions

View File

@@ -102,9 +102,7 @@ export default function AuthenticateUserModal({
open={open}
onClose={onClose}
sx={{ position: "absolute" }}
attributes={{
title: t("password"),
}}
title={t("password")}
>
<VerifyMasterPasswordForm
buttonText={t("AUTHENTICATE")}

View File

@@ -138,7 +138,7 @@ export const AlbumCastDialog: React.FC<AlbumCastDialogProps> = ({
<DialogBoxV2
open={open}
onClose={onClose}
attributes={{ title: t("cast_album_to_tv") }}
title={t("cast_album_to_tv")}
sx={{ zIndex: 1600 }}
>
{view == "choose" && (

View File

@@ -42,9 +42,7 @@ export default function CollectionNamer({ attributes, ...props }: Props) {
<DialogBoxV2
open={props.show}
onClose={props.onHide}
attributes={{
title: attributes.title,
}}
title={attributes.title}
>
<SingleInputForm
callback={onSubmit}

View File

@@ -143,9 +143,7 @@ const DeleteAccountModal = ({ open, onClose }: Iprops) => {
open={open}
onClose={onClose}
fullScreen={isMobile}
attributes={{
title: t("delete_account"),
}}
title={t("delete_account")}
>
<Formik<FormValues>
initialValues={{

View File

@@ -62,9 +62,7 @@ const ExportPendingList = (props: Iprops) => {
PaperProps={{
sx: { maxWidth: "444px" },
}}
attributes={{
title: t("PENDING_ITEMS"),
}}
title={t("PENDING_ITEMS")}
>
<ItemList
maxHeight={240}

View File

@@ -27,9 +27,7 @@ export const FileNameEditDialog = ({
sx={{ zIndex: 1600 }}
open={isInEditMode}
onClose={closeEditMode}
attributes={{
title: t("rename_file"),
}}
title={t("rename_file")}
>
<SingleInputForm
initialValue={filename}

View File

@@ -221,22 +221,18 @@ export function MiniDialog({
// }
// }
export interface 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;
}
type DialogBoxV2Props = React.PropsWithChildren<
Omit<DialogProps, "onClose"> & {
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({
>
<Stack spacing={"36px"} p={"16px"}>
<Stack spacing={"19px"}>
{attributes.title && (
<Typography variant="large" fontWeight={"bold"}>
{attributes.title}
</Typography>
)}
<Typography variant="large" fontWeight={"bold"}>
{title}
</Typography>
{children}
</Stack>
</Stack>