mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Merge pull request #29603 from overleaf/dp-detached-pdf-light
Fix missing light theme for detached pdf GitOrigin-RevId: 61af7e34c44f6d2842ca9d5c1b5d7458a2a1a6c8
This commit is contained in:
+11
-3
@@ -3,6 +3,7 @@ import PdfPreview from './pdf-preview'
|
|||||||
import useWaitForI18n from '../../../shared/hooks/use-wait-for-i18n'
|
import useWaitForI18n from '../../../shared/hooks/use-wait-for-i18n'
|
||||||
import { ReactContextRoot } from '@/features/ide-react/context/react-context-root'
|
import { ReactContextRoot } from '@/features/ide-react/context/react-context-root'
|
||||||
import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils'
|
import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils'
|
||||||
|
import useThemedPage from '@/shared/hooks/use-themed-page'
|
||||||
|
|
||||||
function PdfPreviewDetachedRoot() {
|
function PdfPreviewDetachedRoot() {
|
||||||
const { isReady } = useWaitForI18n()
|
const { isReady } = useWaitForI18n()
|
||||||
@@ -13,13 +14,20 @@ function PdfPreviewDetachedRoot() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ReactContextRoot>
|
<ReactContextRoot>
|
||||||
<EditorRedesignWrapper>
|
<PdfPreviewDetachedRootContent />
|
||||||
<PdfPreview />
|
|
||||||
</EditorRedesignWrapper>
|
|
||||||
</ReactContextRoot>
|
</ReactContextRoot>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function PdfPreviewDetachedRootContent() {
|
||||||
|
useThemedPage() // set the page theme based on user settings
|
||||||
|
|
||||||
|
return (
|
||||||
|
<EditorRedesignWrapper>
|
||||||
|
<PdfPreview />
|
||||||
|
</EditorRedesignWrapper>
|
||||||
|
)
|
||||||
|
}
|
||||||
function EditorRedesignWrapper({ children }: { children: React.ReactNode }) {
|
function EditorRedesignWrapper({ children }: { children: React.ReactNode }) {
|
||||||
const newEditorEnabled = useIsNewEditorEnabled()
|
const newEditorEnabled = useIsNewEditorEnabled()
|
||||||
if (!newEditorEnabled) {
|
if (!newEditorEnabled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user