aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/Loading/Loading.js32
-rw-r--r--src/components/Scoreboard/Scoreboard.js6
2 files changed, 35 insertions, 3 deletions
diff --git a/src/components/Loading/Loading.js b/src/components/Loading/Loading.js
new file mode 100644
index 0000000..632142b
--- /dev/null
+++ b/src/components/Loading/Loading.js
@@ -0,0 +1,32 @@
+import React from 'react';
+
+import {
+ Card,
+ CardHeader,
+} from "@material-ui/core";
+
+import { makeStyles } from "@material-ui/core/styles";
+import CircularProgress from '@material-ui/core/CircularProgress';
+
+
+const useStyles = makeStyles(theme => ({
+ root: {
+ padding: theme.spacing(1),
+ },
+}));
+
+const Loading = () => {
+ const classes = useStyles();
+
+ return (
+ <Card elevation={5} className={classes.root}>
+ <CardHeader
+ avatar={(<CircularProgress color="secondary" />)}
+ title="Loading"
+ subheader="Please, wait."
+ />
+ </Card>
+ )
+};
+
+export default Loading;
diff --git a/src/components/Scoreboard/Scoreboard.js b/src/components/Scoreboard/Scoreboard.js
index 93ec2f0..96a8543 100644
--- a/src/components/Scoreboard/Scoreboard.js
+++ b/src/components/Scoreboard/Scoreboard.js
@@ -7,10 +7,10 @@ import {
} from "@material-ui/core";
import { makeStyles } from "@material-ui/core/styles";
-import LinearProgress from '@material-ui/core/LinearProgress';
import { get } from "../../requests";
import SolutionCard from "../SolutionCard/SolutionCard";
+import Loading from "../Loading/Loading";
const useStyles = makeStyles(theme => ({
@@ -28,7 +28,7 @@ const Scoreboard = () => {
get('solutions/').then(response => {
setTimeout(() => {
setSolutions(response.data);
- }, 250);
+ }, 300);
});
};
@@ -45,7 +45,7 @@ const Scoreboard = () => {
<Typography variant="h3" className={classes.pageHeader}>
Scoreboard
</Typography>
- {(solutions.length === 0) && <LinearProgress color="secondary" />}
+ {(solutions.length === 0) && <Loading />}
<Grid container justify="center" direction="column" spacing={3}>
{solutions.map(solution => (
<Grid item key={solution.id}>