mirror of
https://github.com/uetchy/namae.git
synced 2025-08-20 18:08:11 +09:00
feat: setup test for web
This commit is contained in:
22
web/src/util/suspense.js
Normal file
22
web/src/util/suspense.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import React, { Suspense } from 'react'
|
||||
import styled from 'styled-components'
|
||||
import BarLoader from 'react-spinners/BarLoader'
|
||||
|
||||
export function FullScreenSuspense({ children }) {
|
||||
return <Suspense fallback={<Fallback />}>{children}</Suspense>
|
||||
}
|
||||
|
||||
const Container = styled.div`
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
`
|
||||
|
||||
const Fallback = () => (
|
||||
<Container>
|
||||
<BarLoader />
|
||||
</Container>
|
||||
)
|
Reference in New Issue
Block a user