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
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
// the full-width review panel
|
const hasCommentOrChange = hasActiveRange(ranges, threads)
|
||||||
if (reviewPanelOpen) {
|
const showPanel = reviewPanelOpen || hasCommentOrChange
|
||||||
return ReactDOM.createPortal(<ReviewPanel />, view.scrollDOM)
|
const showTrackChangesWidget = wantTrackChanges && !reviewPanelOpen
|
||||||
}
|
|
||||||
|
|
||||||
// the mini review panel
|
return ReactDOM.createPortal(
|
||||||
if (hasActiveRange(ranges, threads)) {
|
<>
|
||||||
return ReactDOM.createPortal(
|
{showTrackChangesWidget && <TrackChangesOnWidget />}
|
||||||
<>
|
{showPanel && <ReviewPanel mini={!reviewPanelOpen} />}
|
||||||
{wantTrackChanges && <TrackChangesOnWidget />}
|
</>,
|
||||||
<ReviewPanel mini />
|
view.scrollDOM
|
||||||
</>,
|
)
|
||||||
view.scrollDOM
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(ReviewPanelContainer)
|
export default memo(ReviewPanelContainer)
|
||||||
|
|
Loading…
Reference in a new issue