1
0
mirror of https://github.com/uetchy/namae.git synced 2025-03-19 21:40:33 +09:00
namae/web/src/util/suspense.tsx

23 lines
507 B
TypeScript

import React, {Suspense} from 'react';
import styled from 'styled-components';
import BarLoader from 'react-spinners/BarLoader';
export const FullScreenSuspense: React.FC = ({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: React.FC = () => (
<Container>
<BarLoader />
</Container>
);