diff --git a/app/assets/javascripts/components/NoteGroupView.tsx b/app/assets/javascripts/components/NoteGroupView.tsx index cfc03a5ed..7ba477c45 100644 --- a/app/assets/javascripts/components/NoteGroupView.tsx +++ b/app/assets/javascripts/components/NoteGroupView.tsx @@ -3,6 +3,7 @@ import { PureComponent } from '@/components/Abstract/PureComponent'; import { WebApplication } from '@/ui_models/application'; import { MultipleSelectedNotes } from '@/components/MultipleSelectedNotes'; import { NoteView } from '@/components/NoteView/NoteView'; +import { ElementIds } from '@/element_ids'; type State = { showMultipleSelectedNotes: boolean; @@ -40,7 +41,10 @@ export class NoteGroupView extends PureComponent { render() { return ( -
+
{this.state.showMultipleSelectedNotes && ( { render() { if (this.state.showProtectedWarning) { return ( -
+
{this.state.showProtectedWarning && (
{ } return ( -
+
{this.state.noteLocked && ( diff --git a/app/assets/javascripts/element_ids.ts b/app/assets/javascripts/element_ids.ts new file mode 100644 index 000000000..6ba2bacca --- /dev/null +++ b/app/assets/javascripts/element_ids.ts @@ -0,0 +1,6 @@ +export const ElementIds = { + NoteTextEditor: 'note-text-editor', + NoteTitleEditor: 'note-title-editor', + EditorContent: 'editor-content', + EditorColumn: 'editor-column', +}; diff --git a/app/assets/javascripts/ui_models/app_state/note_tags_state.ts b/app/assets/javascripts/ui_models/app_state/note_tags_state.ts index 1a99e5170..fa499ef46 100644 --- a/app/assets/javascripts/ui_models/app_state/note_tags_state.ts +++ b/app/assets/javascripts/ui_models/app_state/note_tags_state.ts @@ -1,3 +1,4 @@ +import { ElementIds } from '@/element_ids'; import { ContentType, SNNote, SNTag, UuidString } from '@standardnotes/snjs'; import { action, computed, makeObservable, observable } from 'mobx'; import { WebApplication } from '../application'; @@ -167,8 +168,9 @@ export class NoteTagsState { } reloadTagsContainerMaxWidth(): void { - const EDITOR_ELEMENT_ID = 'editor-column'; - const editorWidth = document.getElementById(EDITOR_ELEMENT_ID)?.clientWidth; + const editorWidth = document.getElementById( + ElementIds.EditorColumn + )?.clientWidth; if (editorWidth) { this.setTagsContainerMaxWidth(editorWidth); }