update notification component
This commit is contained in:
parent
d445153679
commit
8444ffe49e
|
@ -1,5 +1,6 @@
|
|||
import CloseIcon from '@mui/icons-material/Close';
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
ButtonProps,
|
||||
IconButton,
|
||||
|
@ -30,7 +31,7 @@ export default function Notification({ open, onClose, attributes }: Iprops) {
|
|||
};
|
||||
|
||||
const handleClick = () => {
|
||||
attributes?.onClick();
|
||||
attributes.onClick();
|
||||
onClose();
|
||||
};
|
||||
return (
|
||||
|
@ -55,7 +56,9 @@ export default function Notification({ open, onClose, attributes }: Iprops) {
|
|||
spacing={2}
|
||||
direction="row"
|
||||
alignItems={'center'}>
|
||||
{attributes?.startIcon ?? <InfoIcon />}
|
||||
<Box sx={{ svg: { fontSize: '36px' } }}>
|
||||
{attributes.startIcon ?? <InfoIcon />}
|
||||
</Box>
|
||||
|
||||
<Stack
|
||||
direction={'column'}
|
||||
|
@ -74,8 +77,10 @@ export default function Notification({ open, onClose, attributes }: Iprops) {
|
|||
)}
|
||||
</Stack>
|
||||
|
||||
{attributes?.endIcon ? (
|
||||
<IconButton onClick={attributes.onClick}>
|
||||
{attributes.endIcon ? (
|
||||
<IconButton
|
||||
onClick={attributes.onClick}
|
||||
sx={{ fontSize: '36px' }}>
|
||||
{attributes?.endIcon}
|
||||
</IconButton>
|
||||
) : (
|
||||
|
|
|
@ -463,13 +463,14 @@ export default function Uploader(props: Props) {
|
|||
subtext: constants.STORAGE_QUOTA_EXCEEDED,
|
||||
message: constants.UPGRADE_NOW,
|
||||
onClick: () => galleryContext.showPlanSelectorModal(),
|
||||
startIcon: <DiscFullIcon fontSize="large" />,
|
||||
startIcon: <DiscFullIcon />,
|
||||
};
|
||||
break;
|
||||
default:
|
||||
notification = {
|
||||
variant: 'danger',
|
||||
message: constants.UNKNOWN_ERROR,
|
||||
onClick: () => null,
|
||||
};
|
||||
}
|
||||
appContext.setNotificationAttributes(notification);
|
||||
|
|
|
@ -666,7 +666,6 @@ export default function Gallery() {
|
|||
sidebarView={sidebarView}
|
||||
closeSidebar={closeSidebar}
|
||||
/>
|
||||
|
||||
<PhotoFrame
|
||||
files={files}
|
||||
syncWithRemote={syncWithRemote}
|
||||
|
|
|
@ -6,7 +6,7 @@ export interface NotificationAttributes {
|
|||
variant: ButtonProps['color'];
|
||||
message: JSX.Element | string;
|
||||
subtext?: JSX.Element | string;
|
||||
onClick?: () => void;
|
||||
onClick: () => void;
|
||||
endIcon?: ReactNode;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue