refactor: loading for suspend

This commit is contained in:
zerosoul
2022-06-08 11:28:22 +08:00
parent f28fb11a0d
commit 19b48b20fe
3 changed files with 71 additions and 14 deletions
+8 -4
View File
@@ -13,13 +13,17 @@ opacity: 1;
}
`;
const StyledWrapper = styled.div`
width: 100vw;
height: 100vh;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
gap: 15px;
align-items: center;
justify-content: center;
&.fullscreen {
width: 100vw;
height: 100vh;
}
.loading {
display: flex;
align-items: center;
@@ -33,14 +37,14 @@ const StyledWrapper = styled.div`
}
}
`;
export default function Loading({ reload = false }) {
export default function Loading({ reload = false, fullscreen = false }) {
const { clearLocalData } = useLogout();
const handleReload = () => {
clearLocalData();
location.reload(true);
};
return (
<StyledWrapper>
<StyledWrapper className={fullscreen ? "fullscreen" : ""}>
<Ring
className="loading"
size={40}