chore(trading): fix ssr loader server mismatch, remove preload (#6018)

This commit is contained in:
Matthew Russell 2024-03-15 16:00:04 +00:00 committed by GitHub
parent d9292b9be2
commit 72df08851c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 10 deletions

View File

@ -10,18 +10,12 @@ export default function Document() {
/>
{/* preload fonts */}
<link
rel="preload"
href="/AlphaLyrae.woff"
as="font"
type="font/woff"
/>
<link
rel="preload"
href="/AlphaLyrae.woff2"
as="font"
type="font/woff2"
crossOrigin="anonymous"
/>
{/* icons */}

View File

@ -1,8 +1,8 @@
import { pseudoRandom } from '@vegaprotocol/ui-toolkit';
const generate = pseudoRandom(1);
import { useRef } from 'react';
export const SSRLoader = () => {
const generateRef = useRef(pseudoRandom(1));
return (
<div
style={{
@ -38,7 +38,7 @@ export const SSRLoader = () => {
width: 10,
height: 10,
animation: 'flickering 0.4s linear alternate infinite',
animationDelay: `-${generate()}s`,
animationDelay: `-${generateRef.current()}s`,
animationDirection: i % 2 === 0 ? 'reverse' : 'alternate',
background: 'black',
}}