feature(database-connection): Render spinner on top of UserList component

This commit is contained in:
2021-01-12 12:32:53 +01:00
parent 1b7046788e
commit 4d96bb2674
2 changed files with 8 additions and 12 deletions

View File

@@ -6,14 +6,4 @@
.blurred { .blurred {
@include blurred(); @include blurred();
} }
.UserList-container {
.ClipLoader {
top: -10px;
z-index: 2;
}
.blurred {
z-index: 1;
}
}
} }

View File

@@ -105,6 +105,12 @@ const MainPage: FC<IMainPageProps> = (props: IMainPageProps) => {
.catch(err => setError(err)) .catch(err => setError(err))
}, [seasonId, setLoadingState]) }, [seasonId, setLoadingState])
const spinnerCss = `
margin: 0;
z-index: 2;
position: absolute;
`
return ( return (
<div className="MainPage"> <div className="MainPage">
<Header /> <Header />
@@ -121,7 +127,7 @@ const MainPage: FC<IMainPageProps> = (props: IMainPageProps) => {
} }
{/*<div className="UserList-container">*/} {/*<div className="UserList-container">*/}
{/* <ClipLoader color={spinnerColor} loading={true} size={150} />*/} <ClipLoader color={spinnerColor} loading={loading} size={150} css={spinnerCss} />
<div className={loading ? "blurred" : ""}> <div className={loading ? "blurred" : ""}>
<UserList onSeasonIdChange={setSeasonId} userStats={seasonStats} /> <UserList onSeasonIdChange={setSeasonId} userStats={seasonStats} />
</div> </div>