From 4b07be9d2ec37f65de7d1a2c8012815d7baa599c Mon Sep 17 00:00:00 2001 From: Eug-VS Date: Tue, 7 Jan 2020 00:38:07 +0300 Subject: Support deleting cards on TimerPage --- src/components/TimerPage/TimerPage.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/TimerPage/TimerPage.js b/src/components/TimerPage/TimerPage.js index 968faab..f304b46 100644 --- a/src/components/TimerPage/TimerPage.js +++ b/src/components/TimerPage/TimerPage.js @@ -32,16 +32,20 @@ const TimerPage = ({ recentSolutions, setRecentSolutions }) => { }); }; + const removeSolution = (id) => { + setRecentSolutions(recentSolutions.filter((solution => solution.id !== id))); + }; + return ( - - {recentSolutions.slice(0, 5).map(solution => ( + + {recentSolutions.slice(0, 3).map(solution => ( - + ))} -- cgit v1.2.3