void/components/LoadingScreen.tsx
2022-10-17 22:22:59 +02:00

26 lines
686 B
TypeScript

import styles from 'styles/LoadingScreen.module.sass'
import { useTheme } from 'next-themes'
import Image from 'next/image'
const LoadingScreen = ({
isLoading,
className,
}: {
isLoading: boolean
className?: string
}) => {
const { resolvedTheme: theme } = useTheme()
if (isLoading)
return (
<div data-theme={theme} className={styles.cover}>
<div className={styles.center}>
<svg className={styles.svg} viewBox="0 0 200 200">
<use href={`/ValorantSymbol.svg#${theme}`} />
</svg>
</div>
</div>
)
}
export default LoadingScreen