From 32b1b48eace2c154268da028e80584949f4d904b Mon Sep 17 00:00:00 2001 From: mattyl006 Date: Fri, 29 Jul 2022 09:52:26 +0200 Subject: [PATCH] add reset and done handler to Button on filters menu --- src/components/elements/Button.js | 2 +- .../elements/FiltersMenu/FiltersMenu.js | 16 +++++++++++----- src/pages/Challanges/Challenges.js | 10 +++++----- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/components/elements/Button.js b/src/components/elements/Button.js index 4bdd61a..dadd45c 100644 --- a/src/components/elements/Button.js +++ b/src/components/elements/Button.js @@ -23,7 +23,7 @@ const ButtonStyle = styled(Medium)` const Button = (props) => { return ( - {props.children} diff --git a/src/components/elements/FiltersMenu/FiltersMenu.js b/src/components/elements/FiltersMenu/FiltersMenu.js index c87813a..8b51350 100644 --- a/src/components/elements/FiltersMenu/FiltersMenu.js +++ b/src/components/elements/FiltersMenu/FiltersMenu.js @@ -39,6 +39,14 @@ const FiltersMenuStyle = styled(FlexColumn)` `; const FiltersMenu = (props) => { + const resetHandler = () => { + console.log('siema'); + props.sortByHandler(0); + props.statusHandler(0); + props.challengeTypeHandler(0); + props.commercialHandler(0); + } + return ( <> { handler={props.commercialHandler} option={props.commercial}/> - - - diff --git a/src/pages/Challanges/Challenges.js b/src/pages/Challanges/Challenges.js index 8014ccf..a63a70b 100644 --- a/src/pages/Challanges/Challenges.js +++ b/src/pages/Challanges/Challenges.js @@ -31,23 +31,23 @@ const Challenges = () => { const challengesRequest = () => { getChallenges(setChallengesFromAPI); getChallenges(setChallenges, setLoading); - } + }; const sortByHandler = (value) => { setSortBy(value); - } + }; const statusHandler = (value) => { setStatus(value) - } + }; const challengeTypeHandler = (value) => { setChallengeType(value); - } + }; const commercialHandler = (value) => { setCommercial(value); - } + }; const searchQueryHandler = (event) => { _searchQueryHandler(event, challengesFromAPI, setPageNr, setChallenges);