mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
* Basic focus mode implementation * Exit button * Toggle between editor pdf mode * Keep the rail and file tree mounted for editor tabs to work properly * Hide Switch to editor button in focus mode * Show shortcuts in layout menu * Gate the feature behind a focus-mode feature flag * Add split test badges in the focus mode dropdown item and top bar * Add analytics tracking for focusMode changes * Cleanup leftover IdeView value * Allow passing focusMode value in layout test provider * Remove redundant listener for focus mode shortcut * Update focus mode and full project search listeners to use the event key * Post-rebase cleanup --------- Co-authored-by: Anna Fields <acfields11@gmail.com> GitOrigin-RevId: 207f8d136fa6662558c474cca4a867a9842191e7
28 lines
807 B
TypeScript
28 lines
807 B
TypeScript
import ReactDOM from 'react-dom'
|
|
import { useCodeMirrorViewContext } from '../../source-editor/components/codemirror-context'
|
|
import { memo } from 'react'
|
|
import ReviewPanel from './review-panel'
|
|
import ReviewModeSwitcher from './review-mode-switcher'
|
|
import useReviewPanelLayout from '../hooks/use-review-panel-layout'
|
|
import { useLayoutContext } from '@/shared/context/layout-context'
|
|
|
|
function ReviewPanelContainer() {
|
|
const view = useCodeMirrorViewContext()
|
|
const { showPanel, mini } = useReviewPanelLayout()
|
|
const { focusMode } = useLayoutContext()
|
|
|
|
if (!view) {
|
|
return null
|
|
}
|
|
|
|
return ReactDOM.createPortal(
|
|
<>
|
|
{!focusMode && <ReviewModeSwitcher />}
|
|
{showPanel && <ReviewPanel mini={mini} />}
|
|
</>,
|
|
view.scrollDOM
|
|
)
|
|
}
|
|
|
|
export default memo(ReviewPanelContainer)
|