feat: React 18 + automatic JSX runtime + build --dev (#8961)

This commit is contained in:
Sébastien Lorber 2023-06-08 19:40:15 +02:00 committed by GitHub
parent 76f920359b
commit 187e5aa218
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
69 changed files with 404 additions and 209 deletions

View file

@ -51,17 +51,3 @@ export default function BrowserWindow({
</div>
);
}
// Quick and dirty component, to improve later if needed
export function IframeWindow({url}: {url: string}): JSX.Element {
return (
<div style={{padding: 10}}>
<BrowserWindow
url={url}
style={{minWidth: '40vw', maxWidth: 400}}
bodyStyle={{padding: 0}}>
<iframe src={url} title={url} style={{width: '100%', height: 300}} />
</BrowserWindow>
</div>
);
}

View file

@ -47,9 +47,8 @@ export default function ConfigTabs({
}
</Translate>
</p>
<p>
<CodeBlock language="js" title="docusaurus.config.js">
{`module.exports = {
<CodeBlock language="js" title="docusaurus.config.js">
{`module.exports = {
presets: [
[
'@docusaurus/preset-classic',
@ -61,8 +60,7 @@ export default function ConfigTabs({
],
],
};`}
</CodeBlock>
</p>
</CodeBlock>
</TabItem>
<TabItem value="plugin" label={translate({message: 'Plugin options'})}>
<p>
@ -71,9 +69,8 @@ export default function ConfigTabs({
the plugin:
</Translate>
</p>
<p>
<CodeBlock language="js" title="docusaurus.config.js">
{`module.exports = {
<CodeBlock language="js" title="docusaurus.config.js">
{`module.exports = {
plugins: [
[
'${pluginName}',
@ -83,8 +80,7 @@ export default function ConfigTabs({
],
],
};`}
</CodeBlock>
</p>
</CodeBlock>
</TabItem>
</Tabs>
);

View file

@ -15,7 +15,7 @@ export default function CustomDogfoodNavbarItem(props: {
mobile?: boolean;
}): JSX.Element | null {
const {pathname} = useLocation();
const shouldRender = pathname.includes('/tests/');
const shouldRender = pathname === '/tests' || pathname.startsWith('/tests/');
if (!shouldRender) {
return null;
}

View file

@ -5,7 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import clsx from 'clsx';
import LiteYouTubeEmbed from 'react-lite-youtube-embed';
import Link from '@docusaurus/Link';

View file

@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
import React, {useState, useMemo, useEffect} from 'react';
import {useState, useMemo, useEffect} from 'react';
import clsx from 'clsx';
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
import Translate, {translate} from '@docusaurus/Translate';

View file

@ -5,7 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import Link from '@docusaurus/Link';
import Translate from '@docusaurus/Translate';