@@ -3,6 +3,7 @@ import { Button, IconButton, Menu, MenuItem, Tooltip } from '@affine/component';
33import { useCurrentWorkspacePropertiesAdapter } from '@affine/core/hooks/use-affine-adapter' ;
44import { track } from '@affine/core/mixpanel' ;
55import { DocLinksService } from '@affine/core/modules/doc-link' ;
6+ import { EditorSettingService } from '@affine/core/modules/editor-settting' ;
67import type {
78 PageInfoCustomProperty ,
89 PageInfoCustomPropertyMeta ,
@@ -588,16 +589,21 @@ export const PagePropertiesTableHeader = ({
588589 const manager = useContext ( managerContext ) ;
589590
590591 const t = useI18n ( ) ;
591- const { docLinksServices } = useServices ( {
592+ const {
593+ docLinksServices,
594+ docService,
595+ workspaceService,
596+ editorSettingService,
597+ } = useServices ( {
592598 DocLinksServices : DocLinksService ,
599+ DocService,
600+ WorkspaceService,
601+ EditorSettingService,
593602 } ) ;
594603 const docBacklinks = docLinksServices . backlinks ;
595604 const backlinks = useLiveData ( docBacklinks . backlinks$ ) ;
596605
597- const { docService, workspaceService } = useServices ( {
598- DocService,
599- WorkspaceService,
600- } ) ;
606+ const settings = useLiveData ( editorSettingService . editorSetting . settings$ ) ;
601607
602608 const { syncing, retrying, serverClock } = useLiveData (
603609 workspaceService . workspace . engine . doc . docState$ ( docService . doc . id )
@@ -690,31 +696,33 @@ export const PagePropertiesTableHeader = ({
690696 { dTimestampElement }
691697 </ div >
692698 < Divider />
693- < div className = { styles . tableHeaderSecondaryRow } >
694- < div className = { clsx ( ! open ? styles . pageInfoDimmed : null ) } >
695- { t [ 'com.affine.page-properties.page-info' ] ( ) }
696- </ div >
697- { properties . length === 0 || manager . readonly ? null : (
698- < PagePropertiesSettingsPopup >
699- < IconButton data-testid = "page-info-show-more" size = "20" >
700- < MoreHorizontalIcon />
701- </ IconButton >
702- </ PagePropertiesSettingsPopup >
703- ) }
704- < Collapsible . Trigger asChild role = "button" onClick = { handleCollapse } >
705- < div
706- className = { styles . tableHeaderCollapseButtonWrapper }
707- data-testid = "page-info-collapse"
708- >
709- < IconButton size = "20" >
710- < ToggleExpandIcon
711- className = { styles . collapsedIcon }
712- data-collapsed = { ! open }
713- />
714- </ IconButton >
699+ { settings . displayDocInfo ? (
700+ < div className = { styles . tableHeaderSecondaryRow } >
701+ < div className = { clsx ( ! open ? styles . pageInfoDimmed : null ) } >
702+ { t [ 'com.affine.page-properties.page-info' ] ( ) }
715703 </ div >
716- </ Collapsible . Trigger >
717- </ div >
704+ { properties . length === 0 || manager . readonly ? null : (
705+ < PagePropertiesSettingsPopup >
706+ < IconButton data-testid = "page-info-show-more" size = "20" >
707+ < MoreHorizontalIcon />
708+ </ IconButton >
709+ </ PagePropertiesSettingsPopup >
710+ ) }
711+ < Collapsible . Trigger asChild role = "button" onClick = { handleCollapse } >
712+ < div
713+ className = { styles . tableHeaderCollapseButtonWrapper }
714+ data-testid = "page-info-collapse"
715+ >
716+ < IconButton size = "20" >
717+ < ToggleExpandIcon
718+ className = { styles . collapsedIcon }
719+ data-collapsed = { ! open }
720+ />
721+ </ IconButton >
722+ </ div >
723+ </ Collapsible . Trigger >
724+ </ div >
725+ ) : null }
718726 </ div >
719727 ) ;
720728} ;
0 commit comments