diff --git a/apps/trading/components/app-loader/app-loader.tsx b/apps/trading/components/app-loader/app-loader.tsx index d8f0495c5..caeae848f 100644 --- a/apps/trading/components/app-loader/app-loader.tsx +++ b/apps/trading/components/app-loader/app-loader.tsx @@ -12,7 +12,7 @@ import type { ReactNode } from 'react'; import { AppFailure } from './app-failure'; import { Web3Provider } from './web3-provider'; -const DynamicLoader = dynamic(() => import('../preloader/preloader'), { +export const DynamicLoader = dynamic(() => import('../preloader/preloader'), { loading: () => <>Loading..., }); diff --git a/apps/trading/pages/_app.page.tsx b/apps/trading/pages/_app.page.tsx index 9d0626f03..f7a58f46e 100644 --- a/apps/trading/pages/_app.page.tsx +++ b/apps/trading/pages/_app.page.tsx @@ -33,7 +33,7 @@ import { Connectors } from '../lib/vega-connectors'; import { ViewingBanner } from '../components/viewing-banner'; import { Banner } from '../components/banner'; import classNames from 'classnames'; -import { AppLoader } from '../components/app-loader'; +import { AppLoader, DynamicLoader } from '../components/app-loader'; const DEFAULT_TITLE = t('Welcome to Vega trading!'); @@ -115,7 +115,7 @@ function VegaTradingApp(props: AppProps) { // Prevent HashRouter from being server side rendered as it // relies on presence of document object if (status === 'default') { - return null; + return ; } return ( diff --git a/apps/trading/pages/_document.page.tsx b/apps/trading/pages/_document.page.tsx index 7d7b3c595..132c46236 100644 --- a/apps/trading/pages/_document.page.tsx +++ b/apps/trading/pages/_document.page.tsx @@ -12,6 +12,8 @@ export default function Document() { type="font/woff2" crossOrigin="anonymous" /> + {/* eslint-disable-next-line @next/next/no-css-tags */} + { + let value = seed; + return () => { + value = (value * 16807) % 2147483647; + return value / 1000000000; + }; +}; export interface LoaderProps { size?: 'small' | 'large'; @@ -35,6 +43,8 @@ export const Loader = ({ size === 'small' ? 'w-[15px] h-[15px]' : 'w-[50px] h-[50px]'; const items = size === 'small' ? 9 : 16; + const generate = useMemo(() => pseudoRandom(1), []); + return (
0.75 ? 1 : 0, + opacity: generate() > 1.5 ? 1 : 0, }} /> );