Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 73207cd

Browse files
Merge branch 'issue/47' of https://github.com/praveeno/micro-frontends-earn-app into praveeno-issue/47
2 parents 13db7b8 + ec74478 commit 73207cd

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

Diff for: src/containers/Challenges/Listing/index.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const Listing = ({
2727
bucket,
2828
sortByLabels,
2929
isLoggedIn,
30+
tags,
3031
}) => {
3132
const sortByOptions = utils.createDropdownOptions(
3233
sortByLabels,
@@ -106,7 +107,7 @@ const Listing = ({
106107
<ChallengeItem
107108
challenge={challenge}
108109
onClickTag={(tag) => {
109-
const filterChange = { search: tag };
110+
const filterChange = { tags: [tag] };
110111
updateFilter(filterChange);
111112
}}
112113
onClickTrack={(track) => {

Diff for: src/containers/Challenges/index.jsx

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const Challenges = ({
2828
updateQuery,
2929
userLoggedIn,
3030
isLoggedIn,
31+
tags,
3132
}) => {
3233
const latestPropsRef = useRef(null);
3334
latestPropsRef.current = { userLoggedIn };
@@ -84,6 +85,7 @@ const Challenges = ({
8485
updateQuery(filterChange);
8586
}}
8687
bucket={bucket}
88+
tags={tags}
8789
sortByLabels={sortByLabels}
8890
isLoggedIn={isLoggedIn}
8991
/>
@@ -109,6 +111,7 @@ Challenges.propTypes = {
109111
initialized: PT.bool,
110112
updateQuery: PT.func,
111113
isLoggedIn: PT.bool,
114+
tags: PT.arrayOf(PT.string),
112115
};
113116

114117
const mapStateToProps = (state) => ({
@@ -126,6 +129,7 @@ const mapStateToProps = (state) => ({
126129
recommendedChallenges: state.challenges.recommendedChallenges,
127130
initialized: state.challenges.initialized,
128131
isLoggedIn: state.lookup.isLoggedIn,
132+
tags: state.filter.challenge.tags,
129133
});
130134

131135
const mapDispatchToProps = {

Diff for: src/containers/Filter/ChallengeFilter/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const ChallengeFilter = ({
3333
openForRegistrationCount,
3434
}) => {
3535
// const BUCKET_OPEN_FOR_REGISTRATION = constants.FILTER_BUCKETS[1];
36-
const tagOptions = utils.createDropdownTermOptions(challengeTags);
36+
const tagOptions = utils.createDropdownTermOptions(challengeTags, tags);
3737
const bucketOptions = utils.createRadioOptions(challengeBuckets, bucket);
3838

3939
const caseSensitive = false;

Diff for: src/utils/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function setSelectedDropdownOptions(options, selectedValues) {
4848
export function createDropdownTermOptions(values, selectedValues) {
4949
return values.map((value) => ({
5050
label: `${value}`,
51-
selected: !!selectedValues && selectedValues.includes[value],
51+
selected: !!selectedValues && selectedValues.includes(value),
5252
}));
5353
}
5454

0 commit comments

Comments
 (0)