Merge pull request #10 from Aleksey-Levin/frontend/dice

feat: edit loading
This commit is contained in:
LewinUp 2024-01-08 13:57:18 +08:00 committed by GitHub
commit d8378f3aad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 2 deletions

View file

@ -0,0 +1,20 @@
import LoadingImg from '../../../assets/Capibebra.gif'
import { styled } from '../../../styles'
const LoadingStyle = styled('div', {
width: '100vw',
height: '100vh',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
})
const Loading = () => {
return (
<LoadingStyle>
<img src={LoadingImg} />
</LoadingStyle>
)
}
export default Loading

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

View file

@ -1,10 +1,14 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import { App } from './App.tsx'
import './index.css'
import Loading from "./app/components/Loading/Loading.tsx";
const App = React.lazy(() => import('./App').then(module => ({ default: module.App })))
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<React.Suspense fallback={<Loading />}>
<App />
</React.Suspense>
</React.StrictMode>,
)