feat: Update event modal UI with header icons and improved actions layout
- Add expand and close icons to ResponsiveDialog header in normal mode - Change 'Show More' button to 'More options' with Add icon - Hide Cancel button in normal mode, show only in extended mode - Add showHeaderActions prop to ResponsiveDialog for UI control - Preserve EventDisplayPreview modal with old UI (no header icons) - Update all affected test cases to match new UI behavior
This commit is contained in:
committed by
Benoit TELLIER
parent
4936b89e8b
commit
4c18bf3a52
@@ -10,8 +10,11 @@ import {
|
||||
Stack,
|
||||
SxProps,
|
||||
Theme,
|
||||
Box,
|
||||
} from "@mui/material";
|
||||
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
|
||||
import CloseIcon from "@mui/icons-material/Close";
|
||||
import OpenInFullIcon from "@mui/icons-material/OpenInFull";
|
||||
import React, { ReactNode } from "react";
|
||||
|
||||
/**
|
||||
@@ -73,6 +76,8 @@ interface ResponsiveDialogProps
|
||||
dialogTitleProps?: Omit<DialogTitleProps, "sx">;
|
||||
/** Whether to display dividers between title/content/actions */
|
||||
dividers?: boolean;
|
||||
/** Whether to show header action icons (expand/close) in normal mode (default: true) */
|
||||
showHeaderActions?: boolean;
|
||||
}
|
||||
|
||||
function ResponsiveDialog({
|
||||
@@ -93,6 +98,7 @@ function ResponsiveDialog({
|
||||
dialogContentProps,
|
||||
dialogTitleProps,
|
||||
dividers = false,
|
||||
showHeaderActions = true,
|
||||
sx,
|
||||
...otherDialogProps
|
||||
}: ResponsiveDialogProps) {
|
||||
@@ -150,6 +156,29 @@ function ResponsiveDialog({
|
||||
>
|
||||
<ArrowBackIcon />
|
||||
</IconButton>
|
||||
) : showHeaderActions ? (
|
||||
<Box
|
||||
display="flex"
|
||||
justifyContent="space-between"
|
||||
alignItems="center"
|
||||
width="100%"
|
||||
>
|
||||
<Box>{title}</Box>
|
||||
<Box>
|
||||
{onExpandToggle && (
|
||||
<IconButton
|
||||
onClick={onExpandToggle}
|
||||
aria-label="expand"
|
||||
size="small"
|
||||
>
|
||||
<OpenInFullIcon />
|
||||
</IconButton>
|
||||
)}
|
||||
<IconButton onClick={onClose} aria-label="close" size="small">
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
</Box>
|
||||
</Box>
|
||||
) : (
|
||||
title
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user