@@ -4,7 +4,7 @@ import { default as Sider} from "antd/es/layout/Sider";
4
4
import { PreloadComp } from "comps/comps/preLoadComp" ;
5
5
import UIComp from "comps/comps/uiComp" ;
6
6
import { EditorContext } from "comps/editorState" ;
7
- import { AppUILayoutType } from "constants/applicationConstants" ;
7
+ import { AppPathParams , AppUILayoutType } from "constants/applicationConstants" ;
8
8
import { Layers } from "constants/Layers" ;
9
9
import { TopHeaderHeight } from "constants/style" ;
10
10
import { trans } from "i18n" ;
@@ -38,7 +38,7 @@ import React, {
38
38
} from "react" ;
39
39
import { Helmet } from "react-helmet" ;
40
40
import { useDispatch , useSelector } from "react-redux" ;
41
- import { useLocation } from "react-router-dom" ;
41
+ import { useLocation , useParams } from "react-router-dom" ;
42
42
import { setEditorExternalStateAction } from "redux/reduxActions/configActions" ;
43
43
import { currentApplication } from "redux/selectors/applicationSelector" ;
44
44
import { showAppSnapshotSelector } from "redux/selectors/appSnapshotSelector" ;
@@ -274,6 +274,7 @@ const aggregationSiderItems = [
274
274
275
275
function EditorView ( props : EditorViewProps ) {
276
276
const { uiComp } = props ;
277
+ const params = useParams < AppPathParams > ( ) ;
277
278
const editorState = useContext ( EditorContext ) ;
278
279
const { readOnly, hideHeader } = useContext ( ExternalEditorContext ) ;
279
280
const application = useSelector ( currentApplication ) ;
@@ -296,6 +297,11 @@ function EditorView(props: EditorViewProps) {
296
297
const [ prePanelStatus , setPrePanelStatus ] =
297
298
useState < PanelStatus > ( DefaultPanelStatus ) ;
298
299
300
+ const isViewMode = params . viewMode === 'view' ;
301
+
302
+ const appSettingsComp = editorState . getAppSettingsComp ( ) ;
303
+ const { showHeaderInPublic } = appSettingsComp . getView ( ) ;
304
+
299
305
const togglePanel : TogglePanel = useCallback (
300
306
( key ) => {
301
307
let newPanelStatus ;
@@ -363,7 +369,7 @@ function EditorView(props: EditorViewProps) {
363
369
return ( ) => window . removeEventListener ( eventType , updateSize ) ;
364
370
} , [ ] ) ;
365
371
366
- const hideBodyHeader = useTemplateViewMode ( ) ;
372
+ const hideBodyHeader = useTemplateViewMode ( ) || ( isViewMode && ! showHeaderInPublic ) ;
367
373
368
374
// we check if we are on the public cloud
369
375
const isLowCoderDomain = window . location . hostname === 'app.lowcoder.cloud' ;
@@ -430,7 +436,6 @@ function EditorView(props: EditorViewProps) {
430
436
savePanelStatus ( { ...panelStatus , left } ) ;
431
437
setMenuKey ( params . key ) ;
432
438
} ;
433
- const appSettingsComp = editorState . getAppSettingsComp ( ) ;
434
439
435
440
return (
436
441
< Height100Div
0 commit comments