blob: 399a017c00b4356a90362e4c53320006066231c1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import React, { useEffect, useState } from 'react';
import { Container, Typography } from "@material-ui/core";
import { get } from "../../requests";
import SolutionCard from "../SolutionCard/SolutionCard";
const Scoreboard = () => {
const [solutions, setSolutions] = useState([]);
const updateSolutions = async () => {
const response = await get('solutions/');
await setSolutions(response.data);
};
useEffect(() => {
updateSolutions();
}, []);
return (
<Container maxWidth="sm">
<Typography variant="h3" style={{textAlign: 'center'}}>Scoreboard</Typography>
{solutions.map(solution => (<SolutionCard solution={solution}/>))}
</Container>
);
};
export default Scoreboard;
|