@@ -4,7 +4,7 @@ import { default as Sider} from "antd/es/layout/Sider";
44import { PreloadComp } from "comps/comps/preLoadComp" ;
55import UIComp from "comps/comps/uiComp" ;
66import { EditorContext } from "comps/editorState" ;
7- import { AppUILayoutType } from "constants/applicationConstants" ;
7+ import { AppPathParams , AppUILayoutType } from "constants/applicationConstants" ;
88import { Layers } from "constants/Layers" ;
99import { TopHeaderHeight } from "constants/style" ;
1010import { trans } from "i18n" ;
@@ -38,7 +38,7 @@ import React, {
3838} from "react" ;
3939import { Helmet } from "react-helmet" ;
4040import { useDispatch , useSelector } from "react-redux" ;
41- import { useLocation } from "react-router-dom" ;
41+ import { useLocation , useParams } from "react-router-dom" ;
4242import { setEditorExternalStateAction } from "redux/reduxActions/configActions" ;
4343import { currentApplication } from "redux/selectors/applicationSelector" ;
4444import { showAppSnapshotSelector } from "redux/selectors/appSnapshotSelector" ;
@@ -274,6 +274,7 @@ const aggregationSiderItems = [
274274
275275function EditorView ( props : EditorViewProps ) {
276276 const { uiComp } = props ;
277+ const params = useParams < AppPathParams > ( ) ;
277278 const editorState = useContext ( EditorContext ) ;
278279 const { readOnly, hideHeader } = useContext ( ExternalEditorContext ) ;
279280 const application = useSelector ( currentApplication ) ;
@@ -296,6 +297,11 @@ function EditorView(props: EditorViewProps) {
296297 const [ prePanelStatus , setPrePanelStatus ] =
297298 useState < PanelStatus > ( DefaultPanelStatus ) ;
298299
300+ const isViewMode = params . viewMode === 'view' ;
301+
302+ const appSettingsComp = editorState . getAppSettingsComp ( ) ;
303+ const { showHeaderInPublic } = appSettingsComp . getView ( ) ;
304+
299305 const togglePanel : TogglePanel = useCallback (
300306 ( key ) => {
301307 let newPanelStatus ;
@@ -363,7 +369,7 @@ function EditorView(props: EditorViewProps) {
363369 return ( ) => window . removeEventListener ( eventType , updateSize ) ;
364370 } , [ ] ) ;
365371
366- const hideBodyHeader = useTemplateViewMode ( ) ;
372+ const hideBodyHeader = useTemplateViewMode ( ) || ( isViewMode && ! showHeaderInPublic ) ;
367373
368374 // we check if we are on the public cloud
369375 const isLowCoderDomain = window . location . hostname === 'app.lowcoder.cloud' ;
@@ -430,7 +436,6 @@ function EditorView(props: EditorViewProps) {
430436 savePanelStatus ( { ...panelStatus , left } ) ;
431437 setMenuKey ( params . key ) ;
432438 } ;
433- const appSettingsComp = editorState . getAppSettingsComp ( ) ;
434439
435440 return (
436441 < Height100Div
0 commit comments