diff options
author | Eugene <eug-vs@keemail.me> | 2020-01-02 20:19:22 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-02 20:19:22 +0000 |
commit | c17e83619f4ec7783261ea9ba2a4dffc8b5cad49 (patch) | |
tree | 7366f1896c07973a0e1f6be2a00a8e7b1ac16efb /src/components/Scoreboard/Scoreboard.js | |
parent | 1398e9579be8a0ad478ef16085b431fbb97311f1 (diff) | |
parent | 6bc5060db0f87a767a3caa2be6cf68d243b8d70f (diff) | |
download | chrono-cube-ui-c17e83619f4ec7783261ea9ba2a4dffc8b5cad49.tar.gz |
Merge branch 'master' into timer
Diffstat (limited to 'src/components/Scoreboard/Scoreboard.js')
-rw-r--r-- | src/components/Scoreboard/Scoreboard.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/components/Scoreboard/Scoreboard.js b/src/components/Scoreboard/Scoreboard.js new file mode 100644 index 0000000..1ebca90 --- /dev/null +++ b/src/components/Scoreboard/Scoreboard.js @@ -0,0 +1,28 @@ +import React, {useEffect, useState} from 'react'; + + +import { get } from "../../requests"; +import Solution from "./Solution"; + + +const Scoreboard = () => { + const [solutions, setSolutions] = useState([]); + + const updateSolutions = async () => { + const response = await get('solutions/'); + await setSolutions(response.data); + }; + + useEffect(() => { + updateSolutions(); + }, []); + + + return ( + <div> + { solutions.map(solution => <Solution solution={solution}/>) } + </div> + ); +}; + +export default Scoreboard;
\ No newline at end of file |