mirror of
https://github.com/logto-io/logto.git
synced 2024-12-30 20:33:54 -05:00
fix(console): fix page issues (#6181)
This commit is contained in:
parent
8d721d82df
commit
9b3945a48d
2 changed files with 13 additions and 2 deletions
|
@ -2,6 +2,7 @@ import UriInputField from '@/mdx-components/UriInputField';
|
||||||
import InlineNotification from '@/ds-components/InlineNotification';
|
import InlineNotification from '@/ds-components/InlineNotification';
|
||||||
import Steps from '@/mdx-components/Steps';
|
import Steps from '@/mdx-components/Steps';
|
||||||
import Step from '@/mdx-components/Step';
|
import Step from '@/mdx-components/Step';
|
||||||
|
import NpmLikeInstallation from '@/mdx-components/NpmLikeInstallation';
|
||||||
|
|
||||||
import Checkpoint from '../../fragments/_checkpoint.md';
|
import Checkpoint from '../../fragments/_checkpoint.md';
|
||||||
import RedirectUrisWeb, { defaultRedirectUri, defaultPostSignOutUri } from '../../fragments/_redirect-uris-web.mdx';
|
import RedirectUrisWeb, { defaultRedirectUri, defaultPostSignOutUri } from '../../fragments/_redirect-uris-web.mdx';
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
import { Theme } from '@logto/schemas';
|
import { Theme } from '@logto/schemas';
|
||||||
|
import { noop } from '@silverhand/essentials';
|
||||||
import { type Mermaid as MermaidType } from 'mermaid';
|
import { type Mermaid as MermaidType } from 'mermaid';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
import useTheme from '@/hooks/use-theme';
|
import useTheme from '@/hooks/use-theme';
|
||||||
|
|
||||||
/** Load Mermaid asynchronously from jsDelivr to avoid Parcel issues. */
|
/**
|
||||||
|
* Load Mermaid asynchronously from jsDelivr to avoid Parcel bundling issues. Parcel does not
|
||||||
|
* bundle Mermaid correctly for production builds, so we need to load it dynamically from a CDN.
|
||||||
|
*/
|
||||||
const loadMermaid = async () => {
|
const loadMermaid = async () => {
|
||||||
// Define this variable to "outsmart" the detection of the dynamic import by Parcel:
|
// Define this variable to "outsmart" the detection of the dynamic import by Parcel:
|
||||||
// https://github.com/parcel-bundler/parcel/issues/7064#issuecomment-942441649
|
// https://github.com/parcel-bundler/parcel/issues/7064#issuecomment-942441649
|
||||||
|
@ -17,7 +21,13 @@ const loadMermaid = async () => {
|
||||||
return imported.default;
|
return imported.default;
|
||||||
};
|
};
|
||||||
|
|
||||||
const mermaidPromise = loadMermaid();
|
const mermaidPromise = process.env.CI
|
||||||
|
? // Mock Mermaid in CI to avoid issues with network requests and testing environment.
|
||||||
|
Promise.resolve({
|
||||||
|
initialize: noop,
|
||||||
|
run: noop,
|
||||||
|
})
|
||||||
|
: loadMermaid();
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
readonly children: string;
|
readonly children: string;
|
||||||
|
|
Loading…
Reference in a new issue