Skip to content

Commit a2f779c

Browse files
dhruvang21dhruvang21t-hamanojeffpaulMamaduka
authored
Hide add note in distraction free mode (#72835)
* Hide add note in distraction free mode * refactor: NotesSidebarContainer component code * refactor: remove condition from NotesSidebar component Co-authored-by: dhruvang21 <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: jeffpaul <[email protected]> Co-authored-by: Mamaduka <[email protected]> Co-authored-by: adamsilverstein <[email protected]> Co-authored-by: karthick-murugan <[email protected]>
1 parent de58b89 commit a2f779c

File tree

1 file changed

+15
-10
lines changed
  • packages/editor/src/components/collab-sidebar

1 file changed

+15
-10
lines changed

packages/editor/src/components/collab-sidebar/index.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -208,17 +208,22 @@ function NotesSidebar( { postId, mode } ) {
208208
}
209209

210210
export default function NotesSidebarContainer() {
211-
const { postId, mode, editorMode } = useSelect( ( select ) => {
212-
const { getCurrentPostId, getRenderingMode, getEditorMode } =
213-
select( editorStore );
214-
return {
215-
postId: getCurrentPostId(),
216-
mode: getRenderingMode(),
217-
editorMode: getEditorMode(),
218-
};
219-
}, [] );
211+
const { postId, mode, editorMode, isDistractionFree } = useSelect(
212+
( select ) => {
213+
const { getCurrentPostId, getRenderingMode, getEditorMode } =
214+
select( editorStore );
215+
const { getSettings } = select( blockEditorStore );
216+
return {
217+
postId: getCurrentPostId(),
218+
mode: getRenderingMode(),
219+
editorMode: getEditorMode(),
220+
isDistractionFree: getSettings().isDistractionFree,
221+
};
222+
},
223+
[]
224+
);
220225

221-
if ( ! postId || typeof postId !== 'number' ) {
226+
if ( ! postId || typeof postId !== 'number' || isDistractionFree ) {
222227
return null;
223228
}
224229

0 commit comments

Comments
 (0)