mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
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:
parent
175a4d024d
commit
5fd2b63258
2 changed files with 8 additions and 2 deletions
|
@ -8,6 +8,7 @@ import {
|
|||
import { DecorationSet, EditorView } from '@codemirror/view'
|
||||
import { EditorSelection } from '@codemirror/state'
|
||||
import _ from 'lodash'
|
||||
import { useLayoutContext } from '@/shared/context/layout-context'
|
||||
|
||||
const useMoreCommments = (
|
||||
changes: Change<EditOperation>[],
|
||||
|
@ -19,6 +20,7 @@ const useMoreCommments = (
|
|||
onMoreCommentsBelowClick: null | (() => void)
|
||||
} => {
|
||||
const view = useCodeMirrorViewContext()
|
||||
const { reviewPanelOpen } = useLayoutContext()
|
||||
|
||||
const [positionAbove, setPositionAbove] = useState<number | null>(null)
|
||||
const [positionBelow, setPositionBelow] = useState<number | null>(null)
|
||||
|
@ -32,7 +34,7 @@ const useMoreCommments = (
|
|||
read(view) {
|
||||
const container = view.scrollDOM
|
||||
|
||||
if (!container) {
|
||||
if (!container || !reviewPanelOpen) {
|
||||
return { positionAbove: null, positionBelow: null }
|
||||
}
|
||||
|
||||
|
@ -99,7 +101,7 @@ const useMoreCommments = (
|
|||
}),
|
||||
200
|
||||
),
|
||||
[changes, comments, newComments, view]
|
||||
[changes, comments, newComments, view, reviewPanelOpen]
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
@ -589,6 +589,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
.review-panel-more-comments-button-container {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.review-panel-footer {
|
||||
display: none;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue