From d6ded0900416f7c011a6872ab613a7f5cf732ea8 Mon Sep 17 00:00:00 2001 From: CollinBeczak Date: Fri, 15 Nov 2024 13:26:37 -0600 Subject: [PATCH] add archived filter back --- .../HOCs/WithFilteredChallenges/WithFilteredChallenges.jsx | 3 +++ .../Challenge/ChallengeArchived/ChallengeArchived.js | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 src/services/Challenge/ChallengeArchived/ChallengeArchived.js diff --git a/src/components/HOCs/WithFilteredChallenges/WithFilteredChallenges.jsx b/src/components/HOCs/WithFilteredChallenges/WithFilteredChallenges.jsx index 879d9b736..fb80d7292 100644 --- a/src/components/HOCs/WithFilteredChallenges/WithFilteredChallenges.jsx +++ b/src/components/HOCs/WithFilteredChallenges/WithFilteredChallenges.jsx @@ -11,12 +11,15 @@ import { challengePassesCategorizationKeywordsFilter } from '../../../services/Challenge/ChallengeCategorizationKeywords/ChallengeCategorizationKeywords'; import { challengePassesLocationFilter } from '../../../services/Challenge/ChallengeLocation/ChallengeLocation' +import { challengePassesArchivedFilter } + from '../../../services/Challenge/ChallengeArchived/ChallengeArchived' import { challengePassesGlobalFilter } from '../../../services/Challenge/ChallengeGlobal/ChallengeGlobal' import { challengePassesProjectFilter } from '../../../services/Challenge/ChallengeProject/ChallengeProject' const allFilters = [ + challengePassesArchivedFilter, challengePassesGlobalFilter, challengePassesDifficultyFilter, challengePassesKeywordFilter, diff --git a/src/services/Challenge/ChallengeArchived/ChallengeArchived.js b/src/services/Challenge/ChallengeArchived/ChallengeArchived.js new file mode 100644 index 000000000..2f48987af --- /dev/null +++ b/src/services/Challenge/ChallengeArchived/ChallengeArchived.js @@ -0,0 +1,7 @@ +export const challengePassesArchivedFilter = function(filter, challenge) { + if (!filter.archived) { + return challenge.isArchived === false + } + + return true +}