From 204a70f2a6bc65a9ec9dfc2b13de5c364dc39503 Mon Sep 17 00:00:00 2001 From: Artur Gaspar Date: Thu, 19 Oct 2023 14:07:29 -0300 Subject: [PATCH] fix: video editor spinners vertical alignment The Editor component uses the pgn__modal-fullscreen class to be fullscreen, but it is not structured like a Paragon FullscreenModal and the fullscreen positioning style is not applied correctly, particularly in the case where the content is smaller than the body - a vertically centred component will be centred to the content size, not to the screen. Here we directly apply the style that would have applied to the relevant elements of a Paragon FullscreenModal. --- src/editors/Editor.jsx | 14 +- .../__snapshots__/Editor.test.jsx.snap | 22 +- .../__snapshots__/index.test.jsx.snap | 18 +- .../containers/EditorContainer/index.jsx | 5 +- .../__snapshots__/index.test.jsx.snap | 314 +++++++++--------- .../containers/VideoUploadEditor/index.jsx | 32 +- 6 files changed, 221 insertions(+), 184 deletions(-) diff --git a/src/editors/Editor.jsx b/src/editors/Editor.jsx index d1b14cb38..9236e0474 100644 --- a/src/editors/Editor.jsx +++ b/src/editors/Editor.jsx @@ -31,9 +31,19 @@ export const Editor = ({ const EditorComponent = supportedEditors[blockType]; return ( -
+
diff --git a/src/editors/__snapshots__/Editor.test.jsx.snap b/src/editors/__snapshots__/Editor.test.jsx.snap index 8c929ec63..8a314a651 100644 --- a/src/editors/__snapshots__/Editor.test.jsx.snap +++ b/src/editors/__snapshots__/Editor.test.jsx.snap @@ -3,10 +3,19 @@ exports[`Editor render presents error message if no relevant editor found and ref ready 1`] = `
TextEditor) 1`] = `

My test content @@ -78,7 +83,12 @@ exports[`EditorContainer component render snapshot: initialized. enable save and exports[`EditorContainer component render snapshot: not initialized. disable save and pass to header 1`] = `
- + {isInitialized && children} -
-
-
-
-
- -
- -
-
-
- , -
- , - "container":
+ , +
+ , + "container":
+
+
+
+ +
+ +
,
, diff --git a/src/editors/containers/VideoUploadEditor/index.jsx b/src/editors/containers/VideoUploadEditor/index.jsx index 9dc31ab35..9c91260be 100644 --- a/src/editors/containers/VideoUploadEditor/index.jsx +++ b/src/editors/containers/VideoUploadEditor/index.jsx @@ -9,21 +9,23 @@ export const VideoUploadEditor = () => { const [loading, setLoading] = React.useState(false); const intl = useIntl(); - return ( -
- {(!loading) ? ( -
- -
- ) : ( -
- -
- )} + return (!loading) ? ( +
+ +
+ ) : ( +
+
); };