From 49086481371f180730303326136ba4a04179c3a2 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Thu, 10 Oct 2024 11:08:52 +0530 Subject: [PATCH] Similar to TitledMiniDialog --- web/packages/base/components/MiniDialog.tsx | 60 +++++++++++---------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/web/packages/base/components/MiniDialog.tsx b/web/packages/base/components/MiniDialog.tsx index 197ce808da..bf5408ca70 100644 --- a/web/packages/base/components/MiniDialog.tsx +++ b/web/packages/base/components/MiniDialog.tsx @@ -98,6 +98,7 @@ export const AttributedMiniDialog: React.FC< React.PropsWithChildren > = ({ open, onClose, attributes, children, ...props }) => { const [loading, setLoading] = useState(false); + if (!attributes) { return <>; } @@ -118,47 +119,48 @@ export const AttributedMiniDialog: React.FC< PaperProps={{ ...PaperProps, sx: { - padding: "8px 12px", maxWidth: "360px", ...PaperProps?.sx, }, }} {...rest} > - - - {attributes.icon && ( - svg": { - fontSize: "32px", - }, - }} - > - {attributes.icon} - - )} - {attributes.title && ( - - {attributes.title} - - )} - {children || - (attributes?.content && ( - - {attributes.content} - - ))} - + {attributes.icon && ( + svg": { + fontSize: "32px", + }, + color: "text.muted", + padding: "20px 16px 0px 16px", + }} + > + {attributes.icon} + + )} + {attributes.title && ( + + {attributes.title} + + )} + + {attributes.content && ( + + {attributes.content} + + )} + {children} {(attributes.proceed || attributes.close) && ( {attributes.proceed && ( )} - + ); };