mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Fixed modal footer bug in AdminX
refs. https://github.com/TryGhost/Team/issues/3432
This commit is contained in:
parent
58f51a1838
commit
09b404acd2
@ -25,7 +25,7 @@ const ConfirmationModal: React.FC<ConfirmationModalProps> = ({
|
||||
okColor = 'black',
|
||||
onCancel,
|
||||
onOk,
|
||||
customFooter = false
|
||||
customFooter
|
||||
}) => {
|
||||
const modal = useModal();
|
||||
const [taskState, setTaskState] = useState<'running' | ''>('');
|
||||
|
@ -138,10 +138,6 @@ const Modal: React.FC<ModalProps> = ({
|
||||
((size === 'full' || size === 'bleed') && 'grow')
|
||||
);
|
||||
|
||||
if (!footer) {
|
||||
contentClasses += ' pb-0 ';
|
||||
}
|
||||
|
||||
const handleBackdropClick = (e: React.MouseEvent<HTMLDivElement>) => {
|
||||
if (e.target === e.currentTarget && backDropClick) {
|
||||
modal.remove();
|
||||
@ -152,7 +148,13 @@ const Modal: React.FC<ModalProps> = ({
|
||||
width: size + 'px'
|
||||
} : {};
|
||||
|
||||
const footerContent = (
|
||||
let footerContent;
|
||||
if (footer) {
|
||||
footerContent = footer;
|
||||
} else if (footer === false) {
|
||||
contentClasses += ' pb-0 ';
|
||||
} else {
|
||||
footerContent = (
|
||||
<div className={footerClasses}>
|
||||
<div>
|
||||
{leftButtonLabel &&
|
||||
@ -164,9 +166,9 @@ const Modal: React.FC<ModalProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (footer === undefined) {
|
||||
footer = (stickyFooter ?
|
||||
footerContent = (stickyFooter ?
|
||||
<StickyFooter height={84}>
|
||||
{footerContent}
|
||||
</StickyFooter>
|
||||
@ -175,7 +177,6 @@ const Modal: React.FC<ModalProps> = ({
|
||||
{footerContent}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={backdropClasses} id='modal-backdrop' onClick={handleBackdropClick}>
|
||||
@ -190,7 +191,7 @@ const Modal: React.FC<ModalProps> = ({
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
{footer}
|
||||
{footerContent}
|
||||
</section>
|
||||
</div>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user