- {
- filterState.recommended && activeBucket === 'openForRegistration'
- ? null
- : (
-
diff --git a/src/shared/components/challenge-listing/style.scss b/src/shared/components/challenge-listing/style.scss
index 3e312335dd..5f3dc39577 100644
--- a/src/shared/components/challenge-listing/style.scss
+++ b/src/shared/components/challenge-listing/style.scss
@@ -18,12 +18,43 @@ $challenge-radius-4: $corner-radius * 2;
// }
.ChallengeFiltersExample {
- background: $tc-gray-neutral-dark;
+ background: $tc-white;
flex: 1;
+ margin: 0 32px;
+
+ @include xs-to-md {
+ margin: 0;
+ }
+
+ .tc-title {
+ @include barlow-condensed;
+
+ color: $tco-black;
+ font-size: 32px;
+ margin: 32px 0 24px 0;
+ line-height: 32px;
+ font-weight: 600;
+ text-transform: uppercase;
+
+ @include xs-to-md {
+ margin: 16px;
+ }
+ }
+
+ .tc-seperator {
+ background-color: $listing-gray;
+ height: 2px;
+ opacity: 0.5;
+ margin: 0;
+
+ @include xs-to-md {
+ margin: 0 16px;
+ }
+ }
.tc-content-wrapper {
display: flex;
- padding: $challenge-space-10;
+ padding: 0;
@include xs-to-md {
display: block;
@@ -71,26 +102,28 @@ $challenge-radius-4: $corner-radius * 2;
.sidebar-container-mobile {
margin: $challenge-space-20 $challenge-space-10 $challenge-space-10;
display: none;
+ background-color: $listing-filter-bg;
+ border-radius: 8px;
@include xs-to-md {
display: block;
- margin: 0;
padding: $challenge-space-10;
- width: 100%;
+ padding: 0;
+ margin-top: 24px;
+ margin-bottom: 16px;
+ margin-left: 16px;
+ margin-right: 16px;
+ padding-bottom: 16px;
}
}
.sidebar-container-desktop {
- margin: $challenge-space-20 $challenge-space-5 $challenge-space-10;
- width: 30%;
+ margin: 35px 0 10px;
+ width: 23.5%;
@include xs-to-md {
display: none;
}
-
- > * + * {
- margin-top: 12px;
- }
}
.hidden {
@@ -98,18 +131,39 @@ $challenge-radius-4: $corner-radius * 2;
}
}
+.tag {
+ button {
+ border-radius: 2px;
+ max-width: 400px;
+ font-size: 11px;
+ color: $tco-black;
+ font-weight: 500;
+
+ &:hover {
+ background-color: #d4d4d4 !important;
+ }
+ }
+}
+
.recommended-plus-tag {
margin-left: 3px;
display: inline-block;
background-color: $tc-white;
+
+ button:hover {
+ background-color: #d4d4d4 !important;
+ }
}
.additionalTagWrapper {
- background: $tc-white;
+ background: $tc-black;
display: inline-block;
- border-radius: 3px;
- padding: 5px 5px 10px 5px;
+ border-radius: 2px;
+ padding: 3px 4px;
max-width: 400px;
+ font-size: 11px;
+ color: $tco-black;
+ font-weight: 500;
}
.additionalTagWrapper::after {
@@ -131,4 +185,13 @@ $challenge-radius-4: $corner-radius * 2;
margin-top: 5px;
margin-left: 3px;
display: inline-block;
+
+ & > button:hover {
+ background-color: #d4d4d4 !important;
+ }
+}
+
+.tagContainer {
+ display: flex;
+ margin-top: -2px;
}
diff --git a/src/shared/containers/challenge-listing/ChallengeSearchBar.jsx b/src/shared/containers/challenge-listing/ChallengeSearchBar.jsx
index 254d144973..31b5220630 100644
--- a/src/shared/containers/challenge-listing/ChallengeSearchBar.jsx
+++ b/src/shared/containers/challenge-listing/ChallengeSearchBar.jsx
@@ -7,7 +7,7 @@ import challengeListingActions from 'actions/challenge-listing';
import ChallengeSearchBar from 'components/challenge-listing/Filters/ChallengeSearchBar';
import PT from 'prop-types';
import React from 'react';
-import { isReviewOpportunitiesBucket } from 'utils/challenge-listing/buckets';
+import { isReviewOpportunitiesBucket, isPastBucket } from 'utils/challenge-listing/buckets';
import { connect } from 'react-redux';
import _ from 'lodash';
@@ -34,6 +34,7 @@ export class Container extends React.Component {
} = this.props;
const isForReviewOpportunities = isReviewOpportunitiesBucket(activeBucket);
+ const searchPlaceholderText = isPastBucket(activeBucket) ? 'Search Past Challenges' : 'Search Active Challenges';
return (
);
diff --git a/src/shared/containers/challenge-listing/Listing/index.jsx b/src/shared/containers/challenge-listing/Listing/index.jsx
index 9750569253..103ea774d4 100644
--- a/src/shared/containers/challenge-listing/Listing/index.jsx
+++ b/src/shared/containers/challenge-listing/Listing/index.jsx
@@ -40,6 +40,15 @@ const { mapToBackend } = challengeUtils.filter;
let mounted = false;
export class ListingContainer extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ previousBucketOfActiveTab: null,
+ previousBucketOfPastChallengesTab: null,
+ };
+ }
+
componentDidMount() {
const {
activeBucket,
@@ -470,6 +479,11 @@ export class ListingContainer extends React.Component {
filterState,
} = this.props;
+ const {
+ previousBucketOfActiveTab,
+ previousBucketOfPastChallengesTab,
+ } = this.state;
+
const { tokenV3 } = auth;
const handle = _.get(auth, 'user.handle');
@@ -642,6 +656,14 @@ export class ListingContainer extends React.Component {
isLoggedIn={isLoggedIn}
meta={meta}
setSearchText={setSearchText}
+ previousBucketOfActiveTab={previousBucketOfActiveTab}
+ previousBucketOfPastChallengesTab={previousBucketOfPastChallengesTab}
+ setPreviousBucketOfActiveTab={(bucket) => {
+ this.setState({ previousBucketOfActiveTab: bucket });
+ }}
+ setPreviousBucketOfPastChallengesTab={(bucket) => {
+ this.setState({ previousBucketOfPastChallengesTab: bucket });
+ }}
/>
);
diff --git a/src/shared/utils/challenge-listing/buckets.js b/src/shared/utils/challenge-listing/buckets.js
index 55883e82a0..e58c9b5a66 100644
--- a/src/shared/utils/challenge-listing/buckets.js
+++ b/src/shared/utils/challenge-listing/buckets.js
@@ -56,7 +56,7 @@ export const BUCKET_DATA = {
// status: ['Active'],
// },
// hideCount: false,
- name: 'Open for registration',
+ name: 'Open for Registration',
sorts: [
// SORTS.BEST_MATCH,
SORTS.MOST_RECENT_START_DATE,
@@ -109,7 +109,7 @@ export const BUCKET_DATA = {
[BUCKETS.REVIEW_OPPORTUNITIES]: {
filter: {},
// hideCount: true,
- name: 'Open for review',
+ name: 'Open for Review',
sorts: [
SORTS.REVIEW_OPPORTUNITIES_START_DATE,
SORTS.REVIEW_OPPORTUNITIES_PAYMENT,
diff --git a/src/shared/utils/challenge-listing/date-range.js b/src/shared/utils/challenge-listing/date-range.js
index ead001ec34..bb66396251 100644
--- a/src/shared/utils/challenge-listing/date-range.js
+++ b/src/shared/utils/challenge-listing/date-range.js
@@ -33,19 +33,13 @@ export function createStaticRanges() {
endDate: now.clone().endOf('day').toDate(),
},
{
- label: 'Past 6 Months',
- startDate: past6Months.startOf('day').toDate(),
+ label: 'Past 3 Month',
+ startDate: past3Months.startOf('day').toDate(),
endDate: now.clone().endOf('day').toDate(),
},
{
- label: 'Custom Date',
- startDate: null,
- endDate: null,
- isCustom: true,
- },
- {
- label: 'Past 3 Month',
- startDate: past3Months.startOf('day').toDate(),
+ label: 'Past 6 Months',
+ startDate: past6Months.startOf('day').toDate(),
endDate: now.clone().endOf('day').toDate(),
},
{
@@ -53,7 +47,12 @@ export function createStaticRanges() {
startDate: pastYear.startOf('day').toDate(),
endDate: now.clone().endOf('day').toDate(),
},
-
+ {
+ label: 'Custom Date',
+ startDate: null,
+ endDate: null,
+ isCustom: true,
+ },
];
return ranges.map(range => ({ ...staticRangeHandler, ...range }));
diff --git a/src/shared/utils/challenge-listing/helper.js b/src/shared/utils/challenge-listing/helper.js
index df0df26fe2..fb896d2aa3 100644
--- a/src/shared/utils/challenge-listing/helper.js
+++ b/src/shared/utils/challenge-listing/helper.js
@@ -41,3 +41,23 @@ export function phaseStartDate(phase) {
export function calculateScore(score) {
return Math.ceil(parseFloat(score) * 100.0);
}
+
+/**
+ * Format number to ordinals.
+ * @param {Number} n
+ */
+export const formatOrdinals = (n) => {
+ let ord = '';
+ switch (n) {
+ case '1': ord = '1st';
+ break;
+ case '2': ord = '2nd';
+ break;
+ case '3': ord = '3rd';
+ break;
+ default:
+ ord = `${n}th`;
+ }
+
+ return ord;
+};
diff --git a/src/styles/_mixins/_variables.scss b/src/styles/_mixins/_variables.scss
index e41271f4f1..3405df28c1 100644
--- a/src/styles/_mixins/_variables.scss
+++ b/src/styles/_mixins/_variables.scss
@@ -27,3 +27,12 @@ $dashboard-light-blue: #67aed6;
$dashboard-blue: #009dce;
$dashboard-border: #c4c4c4;
$dashboard-text: #adadad;
+
+/* challenge listing colors */
+$listing-gray: #e5e5e5;
+$listing-light-gray: #d4d4d4;
+$listing-light-blue: #eaf6fd;
+$listing-filter-bg: #f4f4f4;
+$listing-placeholder-gray: #767676;
+$listing-checkbox-green: #137d60;
+$listing-checkbox-blue: #2c95d7;