diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 61792892ae..0c997981ca 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -1335,7 +1335,6 @@ "too_many_search_results": "", "too_recently_compiled": "", "took_a_while": "", - "toolbar_add_comment": "", "toolbar_bullet_list": "", "toolbar_choose_section_heading_level": "", "toolbar_decrease_indent": "", diff --git a/services/web/frontend/js/features/source-editor/components/toolbar/toolbar-items.tsx b/services/web/frontend/js/features/source-editor/components/toolbar/toolbar-items.tsx index 3aa97699f9..2fb546e428 100644 --- a/services/web/frontend/js/features/source-editor/components/toolbar/toolbar-items.tsx +++ b/services/web/frontend/js/features/source-editor/components/toolbar/toolbar-items.tsx @@ -1,15 +1,11 @@ -import { FC, memo, useCallback } from 'react' -import { EditorSelection, EditorState } from '@codemirror/state' -import { EditorView } from '@codemirror/view' +import { FC, memo } from 'react' +import { EditorState } from '@codemirror/state' import { useEditorContext } from '../../../../shared/context/editor-context' -import useScopeEventEmitter from '../../../../shared/hooks/use-scope-event-emitter' -import { useLayoutContext } from '../../../../shared/context/layout-context' import { withinFormattingCommand } from '../../utils/tree-operations/ancestors' import { ToolbarButton } from './toolbar-button' import { redo, undo } from '@codemirror/commands' import * as commands from '../../extensions/toolbar/commands' import { SectionHeadingDropdown } from './section-heading-dropdown' -import { canAddComment } from '../../extensions/toolbar/comments' import getMeta from '../../../../utils/meta' import { InsertFigureDropdown } from './insert-figure-dropdown' import { useTranslation } from 'react-i18next' @@ -34,22 +30,6 @@ export const ToolbarItems: FC<{ const { t } = useTranslation() const { toggleSymbolPalette, showSymbolPalette } = useEditorContext() const isActive = withinFormattingCommand(state) - const addCommentEmitter = useScopeEventEmitter('comment:start_adding') - const { setReviewPanelOpen } = useLayoutContext() - const addComment = useCallback( - (view: EditorView) => { - const range = view.state.selection.main - if (range.empty) { - const line = view.state.doc.lineAt(range.head) - view.dispatch({ - selection: EditorSelection.range(line.from, line.to), - }) - } - setReviewPanelOpen(true) - addCommentEmitter() - }, - [addCommentEmitter, setReviewPanelOpen] - ) const symbolPaletteAvailable = getMeta('ol-symbolPaletteAvailable') const showGroup = (group: string) => !overflowed || overflowed.has(group) @@ -146,14 +126,6 @@ export const ToolbarItems: FC<{ command={commands.insertCite} icon="book" /> -