This is an automated email from the ASF dual-hosted git repository.
paulovmr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git
The following commit(s) were added to refs/heads/main by this push:
new 3f3553bf244 kie-tools-issues#2215: Combined editor > The loading
screen is kept in light mode (#2242)
3f3553bf244 is described below
commit 3f3553bf244bdc0254bbfa0725d9d964f9fc5daa
Author: Handreyrc <[email protected]>
AuthorDate: Tue Apr 30 16:07:32 2024 -0400
kie-tools-issues#2215: Combined editor > The loading screen is kept in
light mode (#2242)
Co-authored-by: Guilherme Caponetto
<[email protected]>
---
.../src/envelope/LoadingScreen/LoadingScreen.tsx | 6 +++--
.../editor/ServerlessWorkflowCombinedEditor.tsx | 28 +++++++++++++++++-----
2 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/packages/editor/src/envelope/LoadingScreen/LoadingScreen.tsx
b/packages/editor/src/envelope/LoadingScreen/LoadingScreen.tsx
index 7a1a89cefe9..722e192d171 100644
--- a/packages/editor/src/envelope/LoadingScreen/LoadingScreen.tsx
+++ b/packages/editor/src/envelope/LoadingScreen/LoadingScreen.tsx
@@ -24,7 +24,7 @@ import { Title } from
"@patternfly/react-core/dist/js/components/Title";
import { Bullseye } from "@patternfly/react-core/dist/js/layouts/Bullseye";
import { useEditorEnvelopeI18nContext } from "../i18n";
-export function LoadingScreen(props: { loading: boolean }) {
+export function LoadingScreen(props: { loading: boolean; styleTag?: string }) {
const [mustRender, setMustRender] = useState(true);
const { i18n } = useEditorEnvelopeI18nContext();
@@ -47,9 +47,11 @@ export function LoadingScreen(props: { loading: boolean }) {
}
}, [props.loading]);
+ const style = (props.styleTag ? `${props.styleTag} ` : "") +
"kie-tools--loading-screen";
+
return (
(mustRender && (
- <div id="loading-screen" className="kie-tools--loading-screen">
+ <div id="loading-screen" className={style}>
<div
className={`kie-tools--loading-screen ${loadingScreenClassName}`}
onAnimationEnd={onAnimationEnd}
diff --git
a/packages/serverless-workflow-combined-editor/src/editor/ServerlessWorkflowCombinedEditor.tsx
b/packages/serverless-workflow-combined-editor/src/editor/ServerlessWorkflowCombinedEditor.tsx
index c1f42b1128b..84972622bf3 100644
---
a/packages/serverless-workflow-combined-editor/src/editor/ServerlessWorkflowCombinedEditor.tsx
+++
b/packages/serverless-workflow-combined-editor/src/editor/ServerlessWorkflowCombinedEditor.tsx
@@ -462,15 +462,17 @@ const RefForwardingServerlessWorkflowCombinedEditor:
ForwardRefRenderFunction<
}
}, [editorEnvelopeCtx, isCombinedEditorReady]);
+ const themeStyle = getThemeStyle(theme!);
+
return (
- <div style={{ height: "100%" }}>
- <LoadingScreen loading={!isCombinedEditorReady} />
+ <div style={{ height: "100%", background: themeStyle.backgroundColor }}>
+ <LoadingScreen loading={!isCombinedEditorReady}
styleTag={themeStyle.loadScreen} />
{previewOptions?.editorMode === "diagram" ? (
renderDiagramEditor()
) : previewOptions?.editorMode === "text" ? (
renderTextEditor()
) : (
- <Drawer isExpanded={true} isInline={true}
className={getThemeStyle(theme!)}>
+ <Drawer isExpanded={true} isInline={true}
className={themeStyle.drawer}>
<DrawerContent
panelContent={
<DrawerPanelContent isResizable={true}
defaultSize={previewOptions?.defaultWidth ?? "50%"}>
@@ -486,13 +488,27 @@ const RefForwardingServerlessWorkflowCombinedEditor:
ForwardRefRenderFunction<
);
};
-function getThemeStyle(theme: EditorTheme) {
+interface ThemeStyleTag {
+ drawer: string;
+ loadScreen: string;
+ backgroundColor: string;
+}
+
+function getThemeStyle(theme: EditorTheme): ThemeStyleTag {
switch (theme) {
case EditorTheme.DARK: {
- return "dark";
+ return {
+ drawer: "dark",
+ loadScreen: "vscode-dark",
+ backgroundColor: "black",
+ };
}
default: {
- return "";
+ return {
+ drawer: "",
+ loadScreen: "",
+ backgroundColor: "",
+ };
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]