- implement tips on loading screen

- implement centralized sections
- removed react-spinner package
This commit is contained in:
Amruth Pillai
2020-07-06 10:02:17 +05:30
parent 65fc779d58
commit 6d3e5823fc
18 changed files with 111 additions and 52 deletions

View File

@ -1,15 +1,16 @@
import { Fade, Modal } from "@material-ui/core";
import React from "react";
import { getRandomTip } from "../../data/tips";
import Logo from "../shared/Logo";
const LoadingScreen = ({ type }) => {
const LoadingScreen = () => {
return (
<Modal open hideBackdrop>
<Fade in>
<div className="w-screen h-screen flex justify-center items-center outline-none">
<div className="flex flex-col items-center">
<Logo size="48px" className="mb-4" />
<span className="font-medium opacity-75">Fetching {type}</span>
<span className="font-medium opacity-75">{getRandomTip()}</span>
</div>
</div>
</Fade>

View File

@ -7,7 +7,7 @@ const PrivateRoute = ({ component: Component, location, ...props }) => {
const { user, loading } = useContext(UserContext);
if (loading) {
return <LoadingScreen type="User" />;
return <LoadingScreen message="Authenticating..." />;
}
if (!user) {