Skip to content

Commit 4373f6c

Browse files
committed
Revert "fix: no challenges found"
This reverts commit 6d3464c.
1 parent d00194c commit 4373f6c

File tree

6 files changed

+2
-31
lines changed

6 files changed

+2
-31
lines changed

__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ exports[`Matches shallow shapshot 1`] = `
8484
expanding={false}
8585
loadMore={[MockFunction]}
8686
loading={false}
87-
needLoad={false}
8887
newChallengeDetails={false}
8988
openChallengesInNewTabs={false}
9089
setFilterState={[MockFunction]}

src/shared/components/challenge-listing/Listing/Bucket/index.jsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import './style.scss';
2424
// const COLLAPSED_SIZE = 10;
2525

2626
// const Filter = challengeUtils.filter;
27-
const LOADING_MESSAGE = 'Loading Challenges';
2827

2928
export default function Bucket({
3029
bucket,
@@ -37,7 +36,6 @@ export default function Bucket({
3736
expand,
3837
filterState,
3938
// keepPlaceholders,
40-
needLoad,
4139
loading,
4240
loadMore,
4341
newChallengeDetails,
@@ -139,12 +137,7 @@ export default function Bucket({
139137
title={BUCKET_DATA[bucket].name}
140138
/>
141139
<h1 styleName="no-results">
142-
{
143-
needLoad ? LOADING_MESSAGE
144-
: (
145-
`${NO_LIVE_CHALLENGES_CONFIG[activeBucket]}`
146-
)
147-
}
140+
{`${NO_LIVE_CHALLENGES_CONFIG[activeBucket]}`}
148141
</h1>
149142
</div>
150143
</div>
@@ -269,7 +262,6 @@ Bucket.defaultProps = {
269262
expand: _.noop,
270263
challengeTypes: [],
271264
// keepPlaceholders: false,
272-
needLoad: false,
273265
loading: false,
274266
loadMore: null,
275267
newChallengeDetails: false,
@@ -294,7 +286,6 @@ Bucket.propTypes = {
294286
challengesUrl: PT.string.isRequired,
295287
filterState: PT.shape().isRequired,
296288
// keepPlaceholders: PT.bool,
297-
needLoad: PT.bool,
298289
loading: PT.bool,
299290
loadMore: PT.func,
300291
newChallengeDetails: PT.bool,

src/shared/components/challenge-listing/Listing/ReviewOpportunityBucket/index.jsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import './style.scss';
1717
const Filter = challengeUtils.filter;
1818

1919
const NO_RESULTS_MESSAGE = 'No challenges found';
20-
const LOADING_MESSAGE = 'Loading Challenges';
2120

2221
// Functional implementation of ReviewOpportunityBucket component
2322
export default function ReviewOpportunityBucket({
@@ -27,7 +26,6 @@ export default function ReviewOpportunityBucket({
2726
expandTag,
2827
filterState,
2928
keepPlaceholders,
30-
needLoad,
3129
loading,
3230
loadMore,
3331
opportunities,
@@ -135,7 +133,7 @@ export default function ReviewOpportunityBucket({
135133
onSelect={setSort}
136134
/>
137135
<h1 styleName="no-results">
138-
{needLoad ? LOADING_MESSAGE : NO_RESULTS_MESSAGE}
136+
{NO_RESULTS_MESSAGE}
139137
</h1>
140138
</div>
141139
</div>
@@ -156,7 +154,6 @@ ReviewOpportunityBucket.defaultProps = {
156154
expandedTags: [],
157155
expandTag: null,
158156
keepPlaceholders: false,
159-
needLoad: false,
160157
loading: false,
161158
loadMore: null,
162159
sort: null,
@@ -172,7 +169,6 @@ ReviewOpportunityBucket.propTypes = {
172169
filterState: PT.shape().isRequired,
173170
opportunities: PT.arrayOf(PT.shape()).isRequired,
174171
keepPlaceholders: PT.bool,
175-
needLoad: PT.bool,
176172
loading: PT.bool,
177173
loadMore: PT.func,
178174
setFilterState: PT.func.isRequired,

src/shared/components/challenge-listing/Listing/index.jsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ function Listing({
4040
// extraBucket,
4141
filterState,
4242
keepPastPlaceholders,
43-
needLoad,
4443
loadingPastChallenges,
4544
loadingReviewOpportunities,
4645
loadingMyChallenges,
@@ -153,7 +152,6 @@ function Listing({
153152
expandTag={expandTag}
154153
filterState={filterState}
155154
keepPlaceholders={keepPastPlaceholders}
156-
needLoad={needLoad}
157155
loading={loadingReviewOpportunities}
158156
loadMore={loadMoreReviewOpportunities}
159157
opportunities={reviewOpportunities}
@@ -184,7 +182,6 @@ function Listing({
184182
expandTag={expandTag}
185183
filterState={filterState}
186184
// keepPlaceholders={keepPlaceholders}
187-
needLoad={needLoad}
188185
loading={loading}
189186
loadMore={loadMore}
190187
newChallengeDetails={newChallengeDetails}
@@ -325,7 +322,6 @@ Listing.propTypes = {
325322
// extraBucket: PT.string,
326323
filterState: PT.shape().isRequired,
327324
keepPastPlaceholders: PT.bool.isRequired,
328-
needLoad: PT.bool.isRequired,
329325
loadingPastChallenges: PT.bool.isRequired,
330326
loadingMyChallenges: PT.bool.isRequired,
331327
loadingMyPastChallenges: PT.bool.isRequired,

src/shared/components/challenge-listing/index.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ export default function ChallengeListing(props) {
118118
// extraBucket={extraBucket}
119119
filterState={props.filterState}
120120
keepPastPlaceholders={keepPastPlaceholders}
121-
needLoad={props.needLoad}
122121
loadingPastChallenges={props.loadingPastChallenges}
123122
loadingMyChallenges={props.loadingMyChallenges}
124123
loadingMyPastChallenges={props.loadingMyPastChallenges}
@@ -242,7 +241,6 @@ ChallengeListing.propTypes = {
242241
keepPastPlaceholders: PT.bool.isRequired,
243242
// lastUpdateOfActiveChallenges: PT.number.isRequired,
244243
// loadingChallenges: PT.bool.isRequired,
245-
needLoad: PT.bool.isRequired,
246244
loadingMyChallenges: PT.bool.isRequired,
247245
loadingMyPastChallenges: PT.bool.isRequired,
248246
loadingAllChallenges: PT.bool.isRequired,

src/shared/containers/challenge-listing/Listing/index.jsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export class ListingContainer extends React.Component {
4444
super(props);
4545

4646
this.state = {
47-
needLoad: true,
4847
previousBucketOfActiveTab: null,
4948
previousBucketOfPastChallengesTab: null,
5049
};
@@ -66,8 +65,6 @@ export class ListingContainer extends React.Component {
6665
filter,
6766
} = this.props;
6867

69-
const { needLoad } = this.state;
70-
7168
markHeaderMenu();
7269

7370
if (queryBucket !== activeBucket && _.includes(BUCKETS, queryBucket)) {
@@ -107,10 +104,6 @@ export class ListingContainer extends React.Component {
107104
});
108105
}
109106
// }
110-
111-
if (needLoad) {
112-
this.setState({ needLoad: false });
113-
}
114107
}
115108

116109
componentDidUpdate(prevProps) {
@@ -502,7 +495,6 @@ export class ListingContainer extends React.Component {
502495
} = this.props;
503496

504497
const {
505-
needLoad,
506498
previousBucketOfActiveTab,
507499
previousBucketOfPastChallengesTab,
508500
} = this.state;
@@ -638,7 +630,6 @@ export class ListingContainer extends React.Component {
638630
keepPastPlaceholders={keepPastPlaceholders}
639631
// lastUpdateOfActiveChallenges={lastUpdateOfActiveChallenges}
640632
// eslint-disable-next-line max-len
641-
needLoad={needLoad}
642633
loadingMyChallenges={Boolean(loadingMyChallengesUUID)}
643634
loadingMyPastChallenges={Boolean(loadingMyPastChallengesUUID)}
644635
loadingAllChallenges={Boolean(loadingAllChallengesUUID)}

0 commit comments

Comments
 (0)