aboutsummaryrefslogtreecommitdiff
path: root/src/components/Scoreboard
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Scoreboard')
-rw-r--r--src/components/Scoreboard/Scoreboard.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/components/Scoreboard/Scoreboard.js b/src/components/Scoreboard/Scoreboard.js
index 48d3c8a..039b951 100644
--- a/src/components/Scoreboard/Scoreboard.js
+++ b/src/components/Scoreboard/Scoreboard.js
@@ -27,6 +27,10 @@ const Scoreboard = () => {
await setSolutions(response.data);
};
+ const removeSolution = (id) => {
+ setSolutions(solutions.filter((solution => solution.id !== id)));
+ };
+
useEffect(() => {
updateSolutions();
}, []);
@@ -39,7 +43,7 @@ const Scoreboard = () => {
<Grid container justify="center" direction="column" spacing={3}>
{solutions.map(solution => (
<Grid item>
- <SolutionCard solution={solution}/>
+ <SolutionCard solution={solution} removeThisCard={removeSolution}/>
</Grid>
))}
</Grid>