mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
Merge pull request #21450 from overleaf/dp-focus-entry
Refactor how ReviewPanel and TrackChangesWidget are rendered GitOrigin-RevId: 0b206a2a70270a885befdcf2403da4e1af3aa9bf
This commit is contained in:
parent
21464f200e
commit
1c7e4ddcd2
1 changed files with 10 additions and 16 deletions
|
@ -20,23 +20,17 @@ function ReviewPanelContainer() {
|
|||
return null
|
||||
}
|
||||
|
||||
// the full-width review panel
|
||||
if (reviewPanelOpen) {
|
||||
return ReactDOM.createPortal(<ReviewPanel />, view.scrollDOM)
|
||||
}
|
||||
const hasCommentOrChange = hasActiveRange(ranges, threads)
|
||||
const showPanel = reviewPanelOpen || hasCommentOrChange
|
||||
const showTrackChangesWidget = wantTrackChanges && !reviewPanelOpen
|
||||
|
||||
// the mini review panel
|
||||
if (hasActiveRange(ranges, threads)) {
|
||||
return ReactDOM.createPortal(
|
||||
<>
|
||||
{wantTrackChanges && <TrackChangesOnWidget />}
|
||||
<ReviewPanel mini />
|
||||
{showTrackChangesWidget && <TrackChangesOnWidget />}
|
||||
{showPanel && <ReviewPanel mini={!reviewPanelOpen} />}
|
||||
</>,
|
||||
view.scrollDOM
|
||||
)
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
export default memo(ReviewPanelContainer)
|
||||
|
|
Loading…
Reference in a new issue