Merge pull request #20811 from overleaf/dp-more-comments-mini

Hide more comments button in mini review panel

GitOrigin-RevId: c41b303e36dfb2fbb0decaecd0e3d63f49568d6b
This commit is contained in:
David 2024-10-04 10:17:21 +01:00 committed by Copybot
parent 175a4d024d
commit 5fd2b63258
2 changed files with 8 additions and 2 deletions

View file

@ -8,6 +8,7 @@ import {
import { DecorationSet, EditorView } from '@codemirror/view' import { DecorationSet, EditorView } from '@codemirror/view'
import { EditorSelection } from '@codemirror/state' import { EditorSelection } from '@codemirror/state'
import _ from 'lodash' import _ from 'lodash'
import { useLayoutContext } from '@/shared/context/layout-context'
const useMoreCommments = ( const useMoreCommments = (
changes: Change<EditOperation>[], changes: Change<EditOperation>[],
@ -19,6 +20,7 @@ const useMoreCommments = (
onMoreCommentsBelowClick: null | (() => void) onMoreCommentsBelowClick: null | (() => void)
} => { } => {
const view = useCodeMirrorViewContext() const view = useCodeMirrorViewContext()
const { reviewPanelOpen } = useLayoutContext()
const [positionAbove, setPositionAbove] = useState<number | null>(null) const [positionAbove, setPositionAbove] = useState<number | null>(null)
const [positionBelow, setPositionBelow] = useState<number | null>(null) const [positionBelow, setPositionBelow] = useState<number | null>(null)
@ -32,7 +34,7 @@ const useMoreCommments = (
read(view) { read(view) {
const container = view.scrollDOM const container = view.scrollDOM
if (!container) { if (!container || !reviewPanelOpen) {
return { positionAbove: null, positionBelow: null } return { positionAbove: null, positionBelow: null }
} }
@ -99,7 +101,7 @@ const useMoreCommments = (
}), }),
200 200
), ),
[changes, comments, newComments, view] [changes, comments, newComments, view, reviewPanelOpen]
) )
useEffect(() => { useEffect(() => {

View file

@ -589,6 +589,10 @@
} }
} }
.review-panel-more-comments-button-container {
display: none;
}
.review-panel-footer { .review-panel-footer {
display: none; display: none;
} }