@@ -5,11 +5,12 @@ import { GreyTextColor } from "constants/style";
5
5
import log from "loglevel" ;
6
6
import { Comp , CompAction , CompConstructor , CompParams , customAction , isCustomAction } from "lowcoder-core" ;
7
7
import { WhiteLoading } from "lowcoder-design" ;
8
- import { useState } from "react" ;
8
+ import { useContext , useState } from "react" ;
9
9
import { useMount } from "react-use" ;
10
10
import styled from "styled-components" ;
11
11
import { RemoteCompInfo , RemoteCompLoader } from "types/remoteComp" ;
12
12
import { withErrorBoundary } from "comps/generators/withErrorBoundary" ;
13
+ import { EditorContext } from "@lowcoder-ee/comps/editorState" ;
13
14
14
15
const ViewError = styled . div `
15
16
display: flex;
@@ -52,6 +53,8 @@ interface LazyCompViewProps {
52
53
function LazyCompView ( props : React . PropsWithChildren < LazyCompViewProps > ) {
53
54
const { loadComp, loadingElement, errorElement } = props ;
54
55
const [ error , setError ] = useState < any > ( "" ) ;
56
+ const editorState = useContext ( EditorContext ) ;
57
+ const showComponentLoadingIndicators = editorState ?. getAppSettings ( ) . showComponentLoadingIndicators ;
55
58
56
59
useMount ( ( ) => {
57
60
setError ( "" ) ;
@@ -71,14 +74,14 @@ function LazyCompView(props: React.PropsWithChildren<LazyCompViewProps>) {
71
74
) ;
72
75
}
73
76
77
+ if ( ! showComponentLoadingIndicators ) return < > </ > ;
78
+
74
79
if ( loadingElement ) {
75
80
return < ViewLoadingWrapper > { loadingElement ( ) } </ ViewLoadingWrapper > ;
76
81
}
77
82
78
83
return (
79
- < ViewLoadingWrapper >
80
- < WhiteLoading />
81
- </ ViewLoadingWrapper >
84
+ < WhiteLoading />
82
85
) ;
83
86
}
84
87
0 commit comments