Display preview on the whole screen

[MAILPOET-2602]
This commit is contained in:
Pavel Dohnal
2020-02-11 10:42:16 +01:00
committed by Jack Kitterhing
parent 8cf8c6004c
commit afd7087112
4 changed files with 16 additions and 0 deletions

View File

@@ -155,3 +155,10 @@ $icon-button-size: 36px;
padding-top: $header-height; padding-top: $header-height;
} }
} }
.mailpoet-modal-full-screen {
height: 100%;
margin: 30px;
max-width: 100%;
min-width: 95%;
}

View File

@@ -15,6 +15,7 @@ function ModalFrame({
className, className,
role, role,
style, style,
fullScreen,
}) { }) {
const wrapperRef = useRef(null); const wrapperRef = useRef(null);
function onClose(event) { function onClose(event) {
@@ -60,6 +61,7 @@ function ModalFrame({
ref={wrapperRef} ref={wrapperRef}
className={classnames( className={classnames(
'mailpoet-modal-frame', 'mailpoet-modal-frame',
{ 'mailpoet-modal-full-screen': fullScreen },
className className
)} )}
style={style} style={style}
@@ -78,6 +80,7 @@ function ModalFrame({
ModalFrame.propTypes = { ModalFrame.propTypes = {
onRequestClose: PropTypes.func, onRequestClose: PropTypes.func,
shouldCloseOnEsc: PropTypes.bool, shouldCloseOnEsc: PropTypes.bool,
fullScreen: PropTypes.bool,
shouldCloseOnClickOutside: PropTypes.bool, shouldCloseOnClickOutside: PropTypes.bool,
role: PropTypes.string, role: PropTypes.string,
className: PropTypes.string, className: PropTypes.string,
@@ -95,6 +98,7 @@ ModalFrame.defaultProps = {
onRequestClose: () => {}, onRequestClose: () => {},
role: 'dialog', role: 'dialog',
shouldCloseOnEsc: true, shouldCloseOnEsc: true,
fullScreen: false,
shouldCloseOnClickOutside: true, shouldCloseOnClickOutside: true,
className: '', className: '',
style: {}, style: {},

View File

@@ -20,6 +20,7 @@ function Modal({
contentClassName, contentClassName,
contentLabel, contentLabel,
overlayClassName, overlayClassName,
fullScreen,
}) { }) {
const headingId = aria.labelledby || 'components-modal-header'; const headingId = aria.labelledby || 'components-modal-header';
@@ -36,6 +37,7 @@ function Modal({
className={contentClassName} className={contentClassName}
contentLabel={contentLabel} contentLabel={contentLabel}
overlayClassName={overlayClassName} overlayClassName={overlayClassName}
fullScreen={fullScreen}
> >
<div <div
className="mailpoet-modal-content" className="mailpoet-modal-content"
@@ -64,6 +66,7 @@ Modal.propTypes = {
title: PropTypes.string, title: PropTypes.string,
onRequestClose: PropTypes.func, onRequestClose: PropTypes.func,
displayTitle: PropTypes.bool, displayTitle: PropTypes.bool,
fullScreen: PropTypes.bool,
focusOnMount: PropTypes.bool, focusOnMount: PropTypes.bool,
shouldCloseOnEsc: PropTypes.bool, shouldCloseOnEsc: PropTypes.bool,
shouldCloseOnClickOutside: PropTypes.bool, shouldCloseOnClickOutside: PropTypes.bool,
@@ -83,6 +86,7 @@ Modal.defaultProps = {
shouldCloseOnClickOutside: true, shouldCloseOnClickOutside: true,
isDismissible: true, isDismissible: true,
displayTitle: true, displayTitle: true,
fullScreen: false,
}; };
export default Modal; export default Modal;

View File

@@ -55,6 +55,7 @@ const FormPreview = () => {
<Modal <Modal
title={MailPoet.I18n.t('formPreview')} title={MailPoet.I18n.t('formPreview')}
onRequestClose={onClose} onRequestClose={onClose}
fullScreen
> >
{form === null && ( {form === null && (
<div className="mailpoet_spinner_wrapper"> <div className="mailpoet_spinner_wrapper">