diff options
author | Eug-VS <eug-vs@keemail.me> | 2020-01-05 02:18:17 +0300 |
---|---|---|
committer | Eug-VS <eug-vs@keemail.me> | 2020-01-05 02:18:17 +0300 |
commit | cc047c9222be0b3d24b43f86f02d30b4bb0a58f2 (patch) | |
tree | 44d3a5dc0fde4da4a1db62c1e74aed0ab8cb7374 | |
parent | c7771b2fe1fdc014ceb694979446f11c3cc7e79d (diff) | |
download | chrono-cube-ui-cc047c9222be0b3d24b43f86f02d30b4bb0a58f2.tar.gz |
Use Grid in Scoreboard
-rw-r--r-- | src/components/Scoreboard/Scoreboard.js | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/components/Scoreboard/Scoreboard.js b/src/components/Scoreboard/Scoreboard.js index 399a017..48d3c8a 100644 --- a/src/components/Scoreboard/Scoreboard.js +++ b/src/components/Scoreboard/Scoreboard.js @@ -1,12 +1,25 @@ import React, { useEffect, useState } from 'react'; -import { Container, Typography } from "@material-ui/core"; +import { + Container, + Typography, + Grid, +} from "@material-ui/core"; import { get } from "../../requests"; import SolutionCard from "../SolutionCard/SolutionCard"; +import { makeStyles } from "@material-ui/core/styles"; +const useStyles = makeStyles(theme => ({ + pageHeader: { + textAlign: 'center', + margin: theme.spacing(2), + } +})); + const Scoreboard = () => { + const classes = useStyles(); const [solutions, setSolutions] = useState([]); const updateSolutions = async () => { @@ -18,11 +31,18 @@ const Scoreboard = () => { updateSolutions(); }, []); - return ( - <Container maxWidth="sm"> - <Typography variant="h3" style={{textAlign: 'center'}}>Scoreboard</Typography> - {solutions.map(solution => (<SolutionCard solution={solution}/>))} + <Container maxWidth="xs"> + <Typography variant="h3" className={classes.pageHeader}> + Scoreboard + </Typography> + <Grid container justify="center" direction="column" spacing={3}> + {solutions.map(solution => ( + <Grid item> + <SolutionCard solution={solution}/> + </Grid> + ))} + </Grid> </Container> ); }; |