diff --git a/documentation/src/theme/NotFound/Content/LoadingForNotFound.tsx b/documentation/src/theme/NotFound/Content/LoadingForNotFound.tsx new file mode 100644 index 000000000..9a7e9207a --- /dev/null +++ b/documentation/src/theme/NotFound/Content/LoadingForNotFound.tsx @@ -0,0 +1,23 @@ +import React from 'react'; +import clsx from 'clsx'; +import Translate from '@docusaurus/Translate'; +import Heading from '@theme/Heading'; +import type { Props } from '@theme/NotFound/Content'; + +function LoadingForNotFound({ className }: Props) { + return ( + + + + + + Loading Page... + + + + + + ); +} + +export default LoadingForNotFound; diff --git a/documentation/src/theme/NotFound/Content/NotFoundWithTimeout.tsx b/documentation/src/theme/NotFound/Content/NotFoundWithTimeout.tsx new file mode 100644 index 000000000..d2a4c7b04 --- /dev/null +++ b/documentation/src/theme/NotFound/Content/NotFoundWithTimeout.tsx @@ -0,0 +1,50 @@ +import React from 'react'; +import clsx from 'clsx'; +import Translate from '@docusaurus/Translate'; +import Heading from '@theme/Heading'; +import type { Props } from '@theme/NotFound/Content'; + +function NotFoundWithTimeout({ className }: Props) { + useTimeout(500); + + return ( + + + + + + Page Not Found + + + + + We could not find what you were looking for. + + + + + Please contact the owner of the site that linked you to the original URL and let them + know their link is broken. + + + + + + ); +} + +let fullfilled = false; +let promise: Promise | null = null; + +const useTimeout = (ms: number) => { + if (!fullfilled) { + throw (promise ||= new Promise((res) => { + setTimeout(() => { + fullfilled = true; + res(); + }, ms); + })); + } +}; + +export default NotFoundWithTimeout; diff --git a/documentation/src/theme/NotFound/Content/index.tsx b/documentation/src/theme/NotFound/Content/index.tsx new file mode 100644 index 000000000..a78be5310 --- /dev/null +++ b/documentation/src/theme/NotFound/Content/index.tsx @@ -0,0 +1,12 @@ +import React, { Suspense } from 'react'; +import type { Props } from '@theme/NotFound/Content'; +import NotFoundWithTimeout from '@site/src/theme/NotFound/Content/NotFoundWithTimeout'; +import LoadingForNotFound from '@site/src/theme/NotFound/Content/LoadingForNotFound'; + +export default function NotFoundContent({ className }: Props): JSX.Element { + return ( + }> + + + ); +}
+ + We could not find what you were looking for. + +
+ + Please contact the owner of the site that linked you to the original URL and let them + know their link is broken. + +