mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-10 14:26:32 +00:00
Merge pull request #8010 from overleaf/ta-synctex-unmount
Unmount Default Synctex Controls in Detacher Mode GitOrigin-RevId: bc754fb172aba7430003f7a61eddb4450b175025
This commit is contained in:
parent
1770cdc8fc
commit
9253dac12f
2 changed files with 13 additions and 3 deletions
|
@ -2,6 +2,14 @@ import PropTypes from 'prop-types'
|
|||
import { useLayoutContext } from '../../../shared/context/layout-context'
|
||||
import PdfSynctexControls from './pdf-synctex-controls'
|
||||
|
||||
export function DefaultSynctexControl() {
|
||||
const { detachRole } = useLayoutContext(layoutContextPropTypes)
|
||||
if (!detachRole) {
|
||||
return <PdfSynctexControls />
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
export function DetacherSynctexControl() {
|
||||
const { detachRole, detachIsLinked } = useLayoutContext(
|
||||
layoutContextPropTypes
|
||||
|
|
|
@ -3,13 +3,15 @@ import { react2angular } from 'react2angular'
|
|||
|
||||
import PdfPreview from '../components/pdf-preview'
|
||||
import { rootContext } from '../../../shared/context/root-context'
|
||||
import PdfSynctexControls from '../components/pdf-synctex-controls'
|
||||
import { DetacherSynctexControl } from '../components/detach-synctex-control'
|
||||
import {
|
||||
DefaultSynctexControl,
|
||||
DetacherSynctexControl,
|
||||
} from '../components/detach-synctex-control'
|
||||
|
||||
App.component('pdfPreview', react2angular(rootContext.use(PdfPreview), []))
|
||||
App.component(
|
||||
'pdfSynctexControls',
|
||||
react2angular(rootContext.use(PdfSynctexControls), [])
|
||||
react2angular(rootContext.use(DefaultSynctexControl), [])
|
||||
)
|
||||
App.component(
|
||||
'detacherSynctexControl',
|
||||
|
|
Loading…
Add table
Reference in a new issue