WEB APP: P8PFullScreenDialog - возможность передачи свойств контейнеру содержимого диалога (contentProps)

This commit is contained in:
Mikhail Chechnev 2025-01-16 15:36:45 +03:00
parent 6fa9d97da4
commit a8a76766f4

View File

@ -27,7 +27,7 @@ const STYLES = {
//-----------
//Полноэкранный диалог
const P8PFullScreenDialog = ({ title, onClose, children }) => {
const P8PFullScreenDialog = ({ title, onClose, contentProps, children }) => {
const handleClose = () => {
onClose ? onClose() : null;
};
@ -46,7 +46,7 @@ const P8PFullScreenDialog = ({ title, onClose, children }) => {
</Toolbar>
</AppBar>
</DialogTitle>
<DialogContent>{children}</DialogContent>
<DialogContent {...(contentProps ? contentProps : {})}>{children}</DialogContent>
</Dialog>
);
};
@ -55,7 +55,8 @@ const P8PFullScreenDialog = ({ title, onClose, children }) => {
P8PFullScreenDialog.propTypes = {
title: PropTypes.string.isRequired,
onClose: PropTypes.func,
children: PropTypes.element
children: PropTypes.element,
contentProps: PropTypes.object
};
//----------------