fix header

This commit is contained in:
sebastien 2025-04-10 13:49:55 +02:00
parent 17a586c28d
commit 32f0a31b11

View file

@ -8,16 +8,28 @@
import React, {type ReactNode} from 'react'; import React, {type ReactNode} from 'react';
import {LiveEditor} from 'react-live'; import {LiveEditor} from 'react-live';
import useIsBrowser from '@docusaurus/useIsBrowser'; import useIsBrowser from '@docusaurus/useIsBrowser';
import Translate from '@docusaurus/Translate';
import PlaygroundHeader from '@theme/Playground/Header';
import styles from './styles.module.css'; import styles from './styles.module.css';
export default function PlaygroundEditor(): ReactNode { export default function PlaygroundEditor(): ReactNode {
const isBrowser = useIsBrowser(); const isBrowser = useIsBrowser();
return ( return (
<LiveEditor <>
// We force remount the editor on hydration, <PlaygroundHeader>
// otherwise dark prism theme is not applied <Translate
key={String(isBrowser)} id="theme.Playground.liveEditor"
className={styles.playgroundEditor} description="The live editor label of the live codeblocks">
/> Live Editor
</Translate>
</PlaygroundHeader>
<LiveEditor
// We force remount the editor on hydration,
// otherwise dark prism theme is not applied
key={String(isBrowser)}
className={styles.playgroundEditor}
/>
</>
); );
} }