feat(editor): Deploy popup always mounted (#51)

This removes the delayed loading when opening the deploy popup
This commit is contained in:
Eric Tuvesson
2024-07-08 12:47:28 +02:00
committed by GitHub
parent 12be6dc69f
commit d61effc615
3 changed files with 133 additions and 124 deletions

View File

@@ -9,6 +9,11 @@
right: 0; right: 0;
bottom: 0; bottom: 0;
&.is-hidden {
visibility: hidden;
pointer-events: none;
}
&.has-backdrop { &.has-backdrop {
background-color: var(--theme-color-bg-1-transparent); background-color: var(--theme-color-bg-1-transparent);
} }

View File

@@ -42,6 +42,7 @@ export interface BaseDialogProps extends UnsafeStyleProps {
isVisible?: boolean; isVisible?: boolean;
hasBackdrop?: boolean; hasBackdrop?: boolean;
hasArrow?: boolean; hasArrow?: boolean;
alwaysMounted?: boolean;
children?: Slot; children?: Slot;
@@ -69,6 +70,7 @@ export function CoreBaseDialog({
isVisible, isVisible,
hasBackdrop, hasBackdrop,
hasArrow, hasArrow,
alwaysMounted,
children, children,
@@ -261,7 +263,7 @@ export function CoreBaseDialog({
} }
}, [background]); }, [background]);
if (!isVisible) return null; if (!isVisible && !alwaysMounted) return null;
return ( return (
<div <div
@@ -270,6 +272,7 @@ export function CoreBaseDialog({
hasBackdrop && css['has-backdrop'], hasBackdrop && css['has-backdrop'],
isLockingScroll && css['is-locking-scroll'], isLockingScroll && css['is-locking-scroll'],
typeof triggerRef === 'undefined' && css['is-centered'], typeof triggerRef === 'undefined' && css['is-centered'],
!isVisible && css['is-hidden'],
css[variant] css[variant]
)} )}
onClick={onClose} onClick={onClose}

View File

@@ -55,6 +55,7 @@ export function DeployPopup(props: DeployPopupProps) {
onClose={props.onClose} onClose={props.onClose}
hasArrow hasArrow
isLockingScroll isLockingScroll
alwaysMounted
> >
<DeployPopupChild /> <DeployPopupChild />
</BaseDialog> </BaseDialog>