From 341ca13244364d2f281486a354398e92a64ed4c9 Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Mon, 20 May 2024 21:31:07 +0000 Subject: [PATCH 01/30] Fix vertical spacing (TOP-1490) --- .../challenge-listing/Sidebar/BucketSelector/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/components/challenge-listing/Sidebar/BucketSelector/index.jsx b/src/shared/components/challenge-listing/Sidebar/BucketSelector/index.jsx index db92ca637c..cdcd599307 100644 --- a/src/shared/components/challenge-listing/Sidebar/BucketSelector/index.jsx +++ b/src/shared/components/challenge-listing/Sidebar/BucketSelector/index.jsx @@ -127,7 +127,7 @@ export default function BucketSelector({ */} ) : ( -
+
{getBucket(BUCKETS.ALL_PAST)} {isAuth ? getBucket(BUCKETS.MY_PAST) : null}
From 8a1922dfd076167f74d531203a046985744f2775 Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Mon, 20 May 2024 22:58:11 +0000 Subject: [PATCH 02/30] Cleanup for TOP-1393 --- .../Header/TabSelector/style.scss | 2 - .../challenge-detail/Header/index.jsx | 8 ++-- .../challenge-detail/Header/style.scss | 40 +------------------ .../Specification/SideBar/index.jsx | 4 +- .../Filters/FiltersPanel/style.scss | 1 - .../communities/iot/AssetDetail/index.jsx | 2 +- 6 files changed, 9 insertions(+), 48 deletions(-) diff --git a/src/shared/components/challenge-detail/Header/TabSelector/style.scss b/src/shared/components/challenge-detail/Header/TabSelector/style.scss index 720a0601ab..48ccb3f99c 100644 --- a/src/shared/components/challenge-detail/Header/TabSelector/style.scss +++ b/src/shared/components/challenge-detail/Header/TabSelector/style.scss @@ -36,7 +36,6 @@ color: $tco-black; font-size: 14px; line-height: 20px; - text-transform: uppercase; padding-left: 16px; padding-top: 10px; } @@ -111,7 +110,6 @@ color: #555; font-size: 14px; line-height: 20px; - text-transform: uppercase; padding-left: 16px; padding-top: 10px; } diff --git a/src/shared/components/challenge-detail/Header/index.jsx b/src/shared/components/challenge-detail/Header/index.jsx index 6d7783e857..88844d3b7d 100644 --- a/src/shared/components/challenge-detail/Header/index.jsx +++ b/src/shared/components/challenge-detail/Header/index.jsx @@ -424,13 +424,13 @@ export default function ChallengeHeader(props) { {hasRegistered ? ( Unregister diff --git a/src/shared/components/challenge-detail/Header/style.scss b/src/shared/components/challenge-detail/Header/style.scss index c8b98c2439..8ceb5a32dc 100644 --- a/src/shared/components/challenge-detail/Header/style.scss +++ b/src/shared/components/challenge-detail/Header/style.scss @@ -75,57 +75,23 @@ } } -.challenge-ops-container .unregisterButton { - @include button-styles; - - color: #137d60 !important; - border: 2px solid #137d60 !important; - background: #fff !important; - - @include xs-to-sm { - width: fit-content; - } -} - -.challenge-ops-container .unregisterButtonDisabled { - @include button-styles; - - color: #767676 !important; - border: 2px solid #f4f4f4; - background: #fff !important; - - @include xs-to-sm { - width: fit-content; - } -} - .challenge-ops-container .submitButton:hover, +.challenge-ops-container .unregisterButton:hover, .challenge-ops-container .registerBtn:hover { color: #fff !important; background: #219174 !important; border-color: #219174 !important; } -.challenge-ops-container .unregisterButton:hover { - color: #219174 !important; - border-color: #219174 !important; - background: #fff !important; -} .challenge-ops-container .submitButton:active, +.challenge-ops-container .unregisterButton:active .challenge-ops-container .registerBtn:active { color: #fff !important; background: #0d664e !important; border-color: #0d664e !important; } -.challenge-ops-container .unregisterButton:active { - outline: none !important; - box-shadow: none !important; - color: #0d664e !important; - border-color: #0d664e !important; - background: #fff !important; -} .challenge-ops-container .submitButton:focus, .challenge-ops-container .submitButton:focus-within, @@ -298,14 +264,12 @@ height: 20px; display: flex; align-items: center; - text-transform: uppercase; &.link { @include roboto-bold; cursor: pointer; color: #137d60; - text-transform: uppercase; font-weight: 700; } diff --git a/src/shared/components/challenge-detail/Specification/SideBar/index.jsx b/src/shared/components/challenge-detail/Specification/SideBar/index.jsx index 01c9e84dcc..c4da35091f 100644 --- a/src/shared/components/challenge-detail/Specification/SideBar/index.jsx +++ b/src/shared/components/challenge-detail/Specification/SideBar/index.jsx @@ -497,14 +497,14 @@ export default function SideBar({
) } - {shareable && ( + {/* {shareable && (

Share

- )} + )} */} {legacyId && (

ID: {legacyId}

diff --git a/src/shared/components/challenge-listing/Filters/FiltersPanel/style.scss b/src/shared/components/challenge-listing/Filters/FiltersPanel/style.scss index 286cab3266..f11e7c152c 100644 --- a/src/shared/components/challenge-listing/Filters/FiltersPanel/style.scss +++ b/src/shared/components/challenge-listing/Filters/FiltersPanel/style.scss @@ -21,7 +21,6 @@ margin: 16px 0 16px 0; border-radius: 24px; border: 1.5px solid #137d60; - text-transform: uppercase; @include xs-to-md { display: block; diff --git a/src/shared/components/tc-communities/communities/iot/AssetDetail/index.jsx b/src/shared/components/tc-communities/communities/iot/AssetDetail/index.jsx index c48929453f..f2aa9739b4 100644 --- a/src/shared/components/tc-communities/communities/iot/AssetDetail/index.jsx +++ b/src/shared/components/tc-communities/communities/iot/AssetDetail/index.jsx @@ -113,7 +113,7 @@ export default function AssetDetail({
- + {/* */} From 760adc5bdaf313b123efa620cefbcf9f018b241a Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Mon, 20 May 2024 23:08:26 +0000 Subject: [PATCH 03/30] Lint and cleanup --- src/shared/components/challenge-detail/Header/index.jsx | 1 + .../challenge-detail/Specification/SideBar/index.jsx | 6 +++--- .../components/challenge-detail/Specification/index.jsx | 2 +- .../tc-communities/communities/iot/AssetDetail/index.jsx | 2 +- src/shared/containers/challenge-listing/Listing/index.jsx | 5 ----- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/shared/components/challenge-detail/Header/index.jsx b/src/shared/components/challenge-detail/Header/index.jsx index 88844d3b7d..73e31221f2 100644 --- a/src/shared/components/challenge-detail/Header/index.jsx +++ b/src/shared/components/challenge-detail/Header/index.jsx @@ -452,6 +452,7 @@ export default function ChallengeHeader(props) { disabled={disabled} theme={{ button: disabled ? style.submitButtonDisabled : style.submitButton }} to={`${challengesUrl}/${challengeId}/submit`} + forceA > Submit a solution diff --git a/src/shared/components/challenge-detail/Specification/SideBar/index.jsx b/src/shared/components/challenge-detail/Specification/SideBar/index.jsx index c4da35091f..fe798be7d0 100644 --- a/src/shared/components/challenge-detail/Specification/SideBar/index.jsx +++ b/src/shared/components/challenge-detail/Specification/SideBar/index.jsx @@ -11,7 +11,7 @@ import { config } from 'topcoder-react-utils'; import TooltipIcon from 'assets/images/tooltip-info.svg'; import EligibleEvents from './EligibleEvents'; -import ShareSocial from './ShareSocial'; +//import ShareSocial from './ShareSocial'; import styles from './styles.scss'; @@ -20,7 +20,7 @@ export default function SideBar({ legacyId, documents, eventDetail, - shareable, + //shareable, forumLink, discuss, hasRegistered, @@ -542,7 +542,7 @@ SideBar.propTypes = { description: PT.string.isRequired, }), documents: PT.arrayOf(PT.shape()), - shareable: PT.bool.isRequired, + //shareable: PT.bool.isRequired, forumLink: PT.string.isRequired, discuss: PT.arrayOf(PT.shape()), hasRegistered: PT.bool, diff --git a/src/shared/components/challenge-detail/Specification/index.jsx b/src/shared/components/challenge-detail/Specification/index.jsx index a838e6e218..c7ec210766 100644 --- a/src/shared/components/challenge-detail/Specification/index.jsx +++ b/src/shared/components/challenge-detail/Specification/index.jsx @@ -407,7 +407,7 @@ export default function ChallengeDetailsView(props) { eventDetail={_.isEmpty(events) ? null : events[0]} isMM={isMM(challenge)} terms={terms} - shareable={_.isEmpty(groups)} + //shareable={_.isEmpty(groups)} environment={environment} codeRepo={codeRepo} metadata={metadata} diff --git a/src/shared/components/tc-communities/communities/iot/AssetDetail/index.jsx b/src/shared/components/tc-communities/communities/iot/AssetDetail/index.jsx index f2aa9739b4..ca75b9c9ac 100644 --- a/src/shared/components/tc-communities/communities/iot/AssetDetail/index.jsx +++ b/src/shared/components/tc-communities/communities/iot/AssetDetail/index.jsx @@ -10,7 +10,7 @@ import PT from 'prop-types'; import { PrimaryButton } from 'topcoder-react-ui-kit'; import JoinSection from '../JoinSection'; -import ShareSocial from './ShareSocial'; +//import ShareSocial from './ShareSocial'; import './styles.scss'; import assetsData from '../Assets/data/predix-assets.json'; diff --git a/src/shared/containers/challenge-listing/Listing/index.jsx b/src/shared/containers/challenge-listing/Listing/index.jsx index 2bd205796c..c37c9d9b0b 100644 --- a/src/shared/containers/challenge-listing/Listing/index.jsx +++ b/src/shared/containers/challenge-listing/Listing/index.jsx @@ -687,11 +687,6 @@ export class ListingContainer extends React.Component { reviewOpportunities={reviewOpportunities} setFilterState={(state) => { setFilter(state); - // if (activeBucket === BUCKETS.SAVED_FILTER) { - // selectBucket(BUCKETS.OPEN_FOR_REGISTRATION); - // } else if (activeBucket === BUCKETS.SAVED_REVIEW_OPPORTUNITIES_FILTER) { - // selectBucket(BUCKETS.REVIEW_OPPORTUNITIES); - // } }} setSort={setSort} sorts={sorts} From b1868aedcd87c6c69f285d6100661fb83a2c7ea4 Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Mon, 20 May 2024 23:40:01 +0000 Subject: [PATCH 04/30] Lint cleanup --- src/shared/components/challenge-detail/Header/style.scss | 4 +--- .../challenge-detail/Specification/SideBar/index.jsx | 6 +++--- .../components/challenge-detail/Specification/index.jsx | 2 +- .../tc-communities/communities/iot/AssetDetail/index.jsx | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/shared/components/challenge-detail/Header/style.scss b/src/shared/components/challenge-detail/Header/style.scss index 8ceb5a32dc..299d11f763 100644 --- a/src/shared/components/challenge-detail/Header/style.scss +++ b/src/shared/components/challenge-detail/Header/style.scss @@ -83,16 +83,14 @@ border-color: #219174 !important; } - .challenge-ops-container .submitButton:active, -.challenge-ops-container .unregisterButton:active +.challenge-ops-container .unregisterButton:active, .challenge-ops-container .registerBtn:active { color: #fff !important; background: #0d664e !important; border-color: #0d664e !important; } - .challenge-ops-container .submitButton:focus, .challenge-ops-container .submitButton:focus-within, .challenge-ops-container .submitButton:focus-visible { diff --git a/src/shared/components/challenge-detail/Specification/SideBar/index.jsx b/src/shared/components/challenge-detail/Specification/SideBar/index.jsx index fe798be7d0..b8d17827d4 100644 --- a/src/shared/components/challenge-detail/Specification/SideBar/index.jsx +++ b/src/shared/components/challenge-detail/Specification/SideBar/index.jsx @@ -11,7 +11,7 @@ import { config } from 'topcoder-react-utils'; import TooltipIcon from 'assets/images/tooltip-info.svg'; import EligibleEvents from './EligibleEvents'; -//import ShareSocial from './ShareSocial'; +// import ShareSocial from './ShareSocial'; import styles from './styles.scss'; @@ -20,7 +20,7 @@ export default function SideBar({ legacyId, documents, eventDetail, - //shareable, + // shareable, forumLink, discuss, hasRegistered, @@ -542,7 +542,7 @@ SideBar.propTypes = { description: PT.string.isRequired, }), documents: PT.arrayOf(PT.shape()), - //shareable: PT.bool.isRequired, + // shareable: PT.bool.isRequired, forumLink: PT.string.isRequired, discuss: PT.arrayOf(PT.shape()), hasRegistered: PT.bool, diff --git a/src/shared/components/challenge-detail/Specification/index.jsx b/src/shared/components/challenge-detail/Specification/index.jsx index c7ec210766..eb29916c10 100644 --- a/src/shared/components/challenge-detail/Specification/index.jsx +++ b/src/shared/components/challenge-detail/Specification/index.jsx @@ -407,7 +407,7 @@ export default function ChallengeDetailsView(props) { eventDetail={_.isEmpty(events) ? null : events[0]} isMM={isMM(challenge)} terms={terms} - //shareable={_.isEmpty(groups)} + // shareable={_.isEmpty(groups)} environment={environment} codeRepo={codeRepo} metadata={metadata} diff --git a/src/shared/components/tc-communities/communities/iot/AssetDetail/index.jsx b/src/shared/components/tc-communities/communities/iot/AssetDetail/index.jsx index ca75b9c9ac..35f9fc5a54 100644 --- a/src/shared/components/tc-communities/communities/iot/AssetDetail/index.jsx +++ b/src/shared/components/tc-communities/communities/iot/AssetDetail/index.jsx @@ -10,7 +10,7 @@ import PT from 'prop-types'; import { PrimaryButton } from 'topcoder-react-ui-kit'; import JoinSection from '../JoinSection'; -//import ShareSocial from './ShareSocial'; +// import ShareSocial from './ShareSocial'; import './styles.scss'; import assetsData from '../Assets/data/predix-assets.json'; From 5b2688cdc256527250cb500bd102c387eefb1f9f Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Tue, 21 May 2024 00:09:56 +0000 Subject: [PATCH 05/30] Fix unregister button styling --- src/shared/components/challenge-detail/Header/style.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shared/components/challenge-detail/Header/style.scss b/src/shared/components/challenge-detail/Header/style.scss index 299d11f763..920ba155e7 100644 --- a/src/shared/components/challenge-detail/Header/style.scss +++ b/src/shared/components/challenge-detail/Header/style.scss @@ -29,6 +29,7 @@ } .challenge-ops-container button, +.challenge-ops-container a, .challenge-ops-container div { margin: 0 !important; } @@ -129,6 +130,7 @@ justify-content: center; div, + button, a { width: fit-content !important; } From fcddb2743cb19f45ef75e7574ea36fd1da03a8f5 Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Tue, 21 May 2024 00:29:54 +0000 Subject: [PATCH 06/30] Better styling for challenge link in Phoenix spec --- .../Specification/styles.scss | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/shared/components/challenge-detail/Specification/styles.scss b/src/shared/components/challenge-detail/Specification/styles.scss index d753cf581a..5d9d9b12b0 100644 --- a/src/shared/components/challenge-detail/Specification/styles.scss +++ b/src/shared/components/challenge-detail/Specification/styles.scss @@ -97,7 +97,6 @@ $tc-link-visited: #0c4e98; color: $tc-black; line-height: 25px; margin: (5 * $base-unit) 0 0; - text-transform: uppercase; } h4 { @@ -274,7 +273,6 @@ $tc-link-visited: #0c4e98; color: $tc-black; line-height: 25px; margin: (5 * $base-unit) 0 0; - text-transform: uppercase; } h4 { @@ -444,3 +442,29 @@ $tc-link-visited: #0c4e98; max-width: 95vw; } } + +article { + >*:first-child { + margin-top: 0; + } +} + +a[href*="/talent-routes/details"] { + width: fit-content; + padding: 11px 23px 11px 19px; + border: 1px solid $color-link-blue-dark; + border-radius: 3px; + font-weight: 500; + text-decoration: none; + + &:hover { + text-decoration: none; + } +} + +*:not(br)+h1, +*:not(br)+h2, +*:not(br)+h3 { + margin-top: 40px; + +} \ No newline at end of file From 45a245d29e39ac3f6f841fe88988adab237a031e Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Tue, 21 May 2024 00:41:55 +0000 Subject: [PATCH 07/30] Lint --- .../challenge-detail/Specification/styles.scss | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/shared/components/challenge-detail/Specification/styles.scss b/src/shared/components/challenge-detail/Specification/styles.scss index 5d9d9b12b0..3e1ec82037 100644 --- a/src/shared/components/challenge-detail/Specification/styles.scss +++ b/src/shared/components/challenge-detail/Specification/styles.scss @@ -1,6 +1,12 @@ @import "~styles/mixins"; $tc-link-visited: #0c4e98; +*:not(br) + h1, +*:not(br) + h2, +*:not(br) + h3 { + margin-top: 40px; +} + .container { border-radius: 0 0 (3 * $corner-radius) (3 * $corner-radius); } @@ -444,8 +450,8 @@ $tc-link-visited: #0c4e98; } article { - >*:first-child { - margin-top: 0; + > *:first-child { + margin-top: 0; } } @@ -461,10 +467,3 @@ a[href*="/talent-routes/details"] { text-decoration: none; } } - -*:not(br)+h1, -*:not(br)+h2, -*:not(br)+h3 { - margin-top: 40px; - -} \ No newline at end of file From ca76e46f458741441b3c1b683bea56757dc621c8 Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Tue, 21 May 2024 21:28:50 +0000 Subject: [PATCH 08/30] Typo --- src/shared/components/challenge-detail/Header/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/components/challenge-detail/Header/index.jsx b/src/shared/components/challenge-detail/Header/index.jsx index 73e31221f2..a7426e0d7c 100644 --- a/src/shared/components/challenge-detail/Header/index.jsx +++ b/src/shared/components/challenge-detail/Header/index.jsx @@ -475,7 +475,7 @@ export default function ChallengeHeader(props) { to={`${topcrowdLink}`} styleName="topcrowd-container" > - View details on Topcoder plaform + View details on Topcoder platform )} From 59b7362cf64d11df6c83a2cced12be02b595827b Mon Sep 17 00:00:00 2001 From: Maria Mattlin Date: Wed, 22 May 2024 09:10:25 -0700 Subject: [PATCH 09/30] TOP-1512 Added some additional styles for the link to Topcoder Phoenix --- .../components/challenge-detail/Specification/styles.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shared/components/challenge-detail/Specification/styles.scss b/src/shared/components/challenge-detail/Specification/styles.scss index 3e1ec82037..13db0603c5 100644 --- a/src/shared/components/challenge-detail/Specification/styles.scss +++ b/src/shared/components/challenge-detail/Specification/styles.scss @@ -462,6 +462,8 @@ a[href*="/talent-routes/details"] { border-radius: 3px; font-weight: 500; text-decoration: none; + display: flex; + gap: 8px; &:hover { text-decoration: none; From c26b6c0f27b462bdc6d772df37c156a10c84549f Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Fri, 24 May 2024 03:01:16 +0000 Subject: [PATCH 10/30] Remove sub-communities (TOP-1548) --- .../__snapshots__/FiltersPanel.jsx.snap | 40 ---------------- .../Filters/FiltersPanel/index.jsx | 46 ------------------- 2 files changed, 86 deletions(-) diff --git a/__tests__/shared/components/challenge-listing/Filters/__snapshots__/FiltersPanel.jsx.snap b/__tests__/shared/components/challenge-listing/Filters/__snapshots__/FiltersPanel.jsx.snap index 280226c6bf..558ab5ccde 100644 --- a/__tests__/shared/components/challenge-listing/Filters/__snapshots__/FiltersPanel.jsx.snap +++ b/__tests__/shared/components/challenge-listing/Filters/__snapshots__/FiltersPanel.jsx.snap @@ -171,46 +171,6 @@ exports[`Matches shallow shapshot 2`] = ` /> -
-
- - - - -
- { - const copyhelper = document.createElement('input'); - copyhelper.className = 'copyhelper'; - document.body.appendChild(copyhelper); - copyhelper.value = `https://www.topcoder.com/gigs/${job.slug}?referralId=${growSurf.data.id}`; - copyhelper.select(); - document.execCommand('copy'); - document.body.removeChild(copyhelper); - setCopyBtnText('COPIED'); - setTimeout(() => { - setCopyBtnText('COPY'); - }, 3000); - }} - > - {copyBtnText} - -
- Share on:   - - - - - - - - - -
-
- - ) : ( -
- Share this job on:   - - - - - - - - - -
- ) - } -
-
- or -
-
-

Refer someone to this gig and earn $500. Just add their email below. See how it works.

-
- setreferrEmail(e.target.value)} ref={ref => refEmailInput = ref} /> - -
-
SUBSCRIBE TO WEEKLY GIG UPDATES
@@ -256,27 +161,6 @@ function GigDetails(props) {
If you have any questions or doubts, don’t hesitate to email gigwork@topcoder.com.
-
- { - isModalOpen - && ( - { - onReferralDone(); - setModalOpen(false); - }} - isReferrSucess={isReferrSucess} - isReferrError={isReferrError} - referralId={growSurf && growSurf.data ? growSurf.data.id : null} - onReferralDone={() => { - onReferralDone(true); - setModalOpen(false); - }} - /> - ) - } -
{ isLoginModalOpen && setLoginModalOpen(false)} /> } @@ -292,19 +176,12 @@ function GigDetails(props) { GigDetails.defaultProps = { application: null, profile: {}, - growSurf: {}, - isReferrError: null, }; GigDetails.propTypes = { job: PT.shape().isRequired, application: PT.shape(), profile: PT.shape(), - onSendClick: PT.func.isRequired, - isReferrSucess: PT.bool.isRequired, - isReferrError: PT.shape(), - onReferralDone: PT.func.isRequired, - growSurf: PT.shape(), }; function mapStateToProps(state) { diff --git a/src/shared/components/Gigs/GigDetails/style.scss b/src/shared/components/Gigs/GigDetails/style.scss index 63e6036d04..145ecf9e39 100644 --- a/src/shared/components/Gigs/GigDetails/style.scss +++ b/src/shared/components/Gigs/GigDetails/style.scss @@ -31,10 +31,6 @@ @include primaryBtn; } -.referral { - display: flex; -} - .container { max-width: $screen-lg; min-height: 50vh; diff --git a/src/shared/components/Gigs/ReferralCode/index.jsx b/src/shared/components/Gigs/ReferralCode/index.jsx deleted file mode 100644 index 1de0976d45..0000000000 --- a/src/shared/components/Gigs/ReferralCode/index.jsx +++ /dev/null @@ -1,120 +0,0 @@ -/* eslint-disable max-len */ -/** - * Connects the Redux store to the GigsPages component. - */ -import React, { useState, useEffect } from 'react'; -import PT from 'prop-types'; -import _ from 'lodash'; -import { PrimaryButton } from 'topcoder-react-ui-kit'; -import LoadingIndicator from 'components/LoadingIndicator'; -import tc from 'components/buttons/themed/tc.scss'; -import ReferralModal from '../ReferralModal'; -import defautlStyle from './style.scss'; - -/** Themes for buttons - * those overwrite PrimaryButton style to match achieve various styles. - * Should implement pattern of classes. - */ -const buttonThemes = { - tc, -}; - -function ReferralCode(props) { - const { profile, growSurf } = props; - const [loginModalOpen, setLoginModalOpen] = useState(false); - const [growSurfState, setGrowSurfState] = useState(growSurf); - const [copyBtnText, setCopyBtnText] = useState('COPY'); - useEffect(() => { - setGrowSurfState(growSurf); - }, [growSurf]); - - return ( -
- { - _.isEmpty(profile) ? ( - Topcoder Referral Program: - ) : ( - Topcoder Referral Program: - ) - } - { - _.isEmpty(profile) ? ( - - Do you know someone who is perfect for a gig? You could earn $500 for referring them! - { - setLoginModalOpen(true); - }} - theme={{ - button: buttonThemes.tc['primary-borderless-sm'], - }} - > - REFER A FRIEND - - { - loginModalOpen - && ( - setLoginModalOpen(false)} - isReferrSucess={false} - isReferrError={false} - onReferralDone={() => { }} - /> - ) - } - - ) : ( - - Your referral link: - { - growSurfState.loading && - } - { - growSurfState.data && ( -
- {`https://www.topcoder.com/gigs?referralId=${growSurfState.data.id}`} - { - const copyhelper = document.createElement('input'); - copyhelper.className = 'copyhelper'; - document.body.appendChild(copyhelper); - copyhelper.value = `https://www.topcoder.com/gigs?referralId=${growSurfState.data.id}`; - copyhelper.select(); - document.execCommand('copy'); - document.body.removeChild(copyhelper); - setCopyBtnText('COPIED'); - setTimeout(() => { - setCopyBtnText('COPY'); - }, 3000); - }} - theme={{ - button: buttonThemes.tc['primary-borderless-xs'], - }} - > - {copyBtnText} - -
- ) - } - { - growSurfState.error && Oops, we couldn't load your profile. Please try again later or contact support. - } -
- ) - } -
- ); -} - -ReferralCode.defaultProps = { - profile: {}, - growSurf: {}, -}; - -ReferralCode.propTypes = { - profile: PT.shape(), - growSurf: PT.shape(), -}; - -export default ReferralCode; diff --git a/src/shared/components/Gigs/ReferralCode/style.scss b/src/shared/components/Gigs/ReferralCode/style.scss deleted file mode 100644 index 3c35b10fef..0000000000 --- a/src/shared/components/Gigs/ReferralCode/style.scss +++ /dev/null @@ -1,107 +0,0 @@ -.container, -.containerWithLink { - display: flex; - background-image: linear-gradient(97.21deg, #2984bd 0%, #0ab88a 100%); - border-radius: 10px; - width: 100%; - max-width: 1280px; - margin: 30px auto 0; - align-items: center; - padding: 13px 25px 11px; - - @media screen and (max-width: 1280px) { - margin: 30px 15px 0; - width: auto; - } - - @media screen and (max-width: 768px) { - flex-direction: column; - align-items: flex-start; - } - - .title { - font-weight: bold; - color: #fff; - font-family: Roboto, sans-serif; - font-size: 18px; - margin-right: 5px; - - @media screen and (max-width: 768px) { - margin-bottom: 10px; - } - } - - span { - font-family: Roboto, sans-serif; - font-size: 18px; - color: #fff; - line-height: 22px; - margin-right: 5px; - } - - button { - margin-left: 10px !important; - - &:hover { - margin-left: 10px !important; - } - - @media screen and (max-width: 768px) { - margin: 10px 0 0 !important; - - &:hover { - margin: 10px 0 0 !important; - } - } - } - - .rondedArea { - border: 1px solid rgba(255, 255, 255, 0.4); - border-radius: 2px; - height: 35px; - display: flex; - align-items: center; - padding: 0 12px; - - @media screen and (max-width: 768px) { - max-width: 100%; - flex-direction: column; - align-items: flex-start; - position: relative; - width: 100%; - height: auto; - padding: 6px; - margin-bottom: 40px; - } - - span { - white-space: nowrap; - - @media screen and (max-width: 768px) { - max-width: 100%; - display: block; - overflow: auto; - margin-right: 0; - } - } - - button { - @media screen and (max-width: 768px) { - position: absolute; - bottom: -30px; - margin: 0 !important; - left: 0; - } - } - } -} - -.containerWithLink { - padding: 10px 25px 9px; - - svg { - width: 34px; - height: 34px; - margin: initial; - } -} diff --git a/src/shared/components/Gigs/ReferralModal/index.jsx b/src/shared/components/Gigs/ReferralModal/index.jsx deleted file mode 100644 index 82f4d3c998..0000000000 --- a/src/shared/components/Gigs/ReferralModal/index.jsx +++ /dev/null @@ -1,137 +0,0 @@ -/* eslint-disable max-len */ -/** - * The modal used for gig referral flow - */ - -/* global window */ - -import { isEmpty } from 'lodash'; -import PT from 'prop-types'; -import React from 'react'; -import { Modal, PrimaryButton } from 'topcoder-react-ui-kit'; -import { config, Link } from 'topcoder-react-utils'; -import tc from 'components/buttons/themed/tc.scss'; -import LoadingIndicator from 'components/LoadingIndicator'; -import modalStyle from './modal.scss'; - -/** Themes for buttons - * those overwrite PrimaryButton style to match achieve various styles. - * Should implement pattern of classes. - */ -const buttonThemes = { - tc, -}; - -// help article link -const HELP_INFO_LINK = '/community/gig-referral'; - -function ReferralModal({ - profile, - onCloseButton, - isReferrSucess, - isReferrError, - referralId, - onReferralDone, -}) { - const retUrl = window.location.href; - return ( - - { !isEmpty(profile) ? ( -
- { - referralId && !isReferrError && !isReferrSucess && ( -
-

Sending your referral...

- -
- ) - } - { - isReferrSucess ? ( -
-

CONGRATULATIONS!

-

Your referral has been sent.

-
- - CLOSE - - FIND ANOTHER GIG -
-
- ) : null - } - { - isReferrError ? ( -
-

OOPS!

-

{isReferrError.message}

- { - isReferrError.userError ? ( -

If you think this is an error please contact support@topcoder.com.

- ) : ( -

Looks like there is a problem on our end. Please try again.
If this persists please contact support@topcoder.com.

- ) - } -
- - CLOSE - - FIND ANOTHER GIG -
-
- ) : null - } -
- ) : ( -
-

REFERRAL PROGRAM

-

Please login to receive your referral code.

-
- { - window.location = `${config.URL.AUTH}/member?retUrl=${encodeURIComponent(retUrl)}`; - }} - theme={{ - button: buttonThemes.tc['primary-green-md'], - }} - > - LOGIN - - REGISTER -
-

Find out how the referral program works here.

-
- )} -
- ); -} - -ReferralModal.defaultProps = { - profile: null, - referralId: null, - isReferrError: null, -}; - -ReferralModal.propTypes = { - profile: PT.shape(), - onCloseButton: PT.func.isRequired, - isReferrSucess: PT.bool.isRequired, - isReferrError: PT.shape(), - referralId: PT.string, - onReferralDone: PT.func.isRequired, -}; - -export default ReferralModal; diff --git a/src/shared/components/Gigs/ReferralModal/modal.scss b/src/shared/components/Gigs/ReferralModal/modal.scss deleted file mode 100644 index ec36a10e32..0000000000 --- a/src/shared/components/Gigs/ReferralModal/modal.scss +++ /dev/null @@ -1,133 +0,0 @@ -/* stylelint-disable no-descending-specificity */ -@import "~styles/mixins"; -@import "~components/Contentful/default"; - -.container { - padding: 0; - width: auto; - max-width: 95vw; - height: auto; - max-height: 95vh; - border-radius: 10px; - display: flex; - flex-direction: column; - justify-content: center; - - @include gui-kit-headers; - @include gui-kit-content; - - .title { - color: #1e94a3; - font-family: BarlowCondensed, sans-serif; - font-size: 34px; - line-height: 38px; - font-weight: 500; - margin: 0; - margin-bottom: 20px; - } - - .loginMsg { - color: #2a2a2a; - font-size: 24px; - line-height: 36px; - margin-bottom: 40px; - } - - .ctaButtons { - display: flex; - align-content: center; - justify-content: center; - - & > button:first-child { - margin-right: 10px !important; - } - - & > a:first-child { - margin-right: 10px !important; - } - } - - .referrals { - display: flex; - overflow: auto; - - .sucessMsg { - font-size: 24px; - line-height: 36px; - margin-bottom: 40px; - } - - .rightAlign { - justify-content: flex-end; - } - - .referrForm { - display: flex; - flex-direction: column; - padding: 60px 84px 40px; - min-width: 618px; - - @include xs-to-sm { - padding: 20px; - width: 90vw; - min-width: auto; - } - - h3 { - margin-bottom: 12px; - text-align: center; - } - - .margin { - margin-top: 10px; - } - - :global { - textarea { - height: 250px; - } - } - - .ctaButtons { - justify-content: flex-end; - margin-top: 20px; - } - } - } - - .loginRequired, - .referrSucess { - display: flex; - flex-direction: column; - padding: 100px 80px; - text-align: center; - - @include xs-to-sm { - padding: 50px 40px; - } - - .loginMsg { - font-size: 20px; - } - - .regTxt { - font-size: 14px; - margin: 10px 0 0; - } - - .ctaButtons { - @include xs-to-sm { - flex-direction: column; - - > button { - margin: 0 0 20px !important; - } - } - } - } -} - -.overlay { - background-color: #2a2a2a; - opacity: 0.95; -} diff --git a/src/shared/containers/Gigs/RecruitCRMJobDetails.jsx b/src/shared/containers/Gigs/RecruitCRMJobDetails.jsx index 8ec55e9b0e..130c84073e 100644 --- a/src/shared/containers/Gigs/RecruitCRMJobDetails.jsx +++ b/src/shared/containers/Gigs/RecruitCRMJobDetails.jsx @@ -10,33 +10,9 @@ import GigDetails from 'components/Gigs/GigDetails'; import PT from 'prop-types'; import React from 'react'; import { connect } from 'react-redux'; -import { config } from 'topcoder-react-utils'; -import fetch from 'isomorphic-fetch'; import RecruitCRMJobApply from './RecruitCRMJobApply'; -const PROXY_ENDPOINT = `${config.URL.COMMUNITY_APP}/api`; - class RecruitCRMJobDetailsContainer extends React.Component { - constructor(props) { - super(props); - - this.state = { - isReferrSucess: false, - formErrors: {}, - formData: { - body: `Hey there! - -Topcoder has a freelance gig that I thought you would be interested in. If you get the gig, I could earn cash! - -Check it out: -${config.URL.BASE}${config.GIGS_PAGES_PATH}/${props.id}`, - }, - }; - - this.onSendClick = this.onSendClick.bind(this); - this.onReferralDone = this.onReferralDone.bind(this); - } - componentDidMount() { const { getJob, @@ -49,136 +25,6 @@ ${config.URL.BASE}${config.GIGS_PAGES_PATH}/${props.id}`, } } - /** - * Send gig referral invite - */ - async onSendClick(email) { - const { - profile, growSurf, tokenV3, - } = this.props; - const { formData } = this.state; - // should not be able to send emails to themselves - if (profile.email === email) { - this.setState({ - isReferrError: { - message: 'You are not allowed to send to yourself.', - userError: true, - }, - }); - // exit no email sending - return; - } - // check if email is already referred? - const growCheck = await fetch(`${PROXY_ENDPOINT}/growsurf/participant/${email}`); - if (growCheck.status === 200) { - const growCheckData = await growCheck.json(); - if (growCheckData.referrer) { - this.setState({ - isReferrError: { - message: `${email} has already been referred.`, - userError: true, - }, - }); - // exit no email sending - return; - } - } - // // email the invite - const res = await fetch(`${PROXY_ENDPOINT}/mailchimp/email`, { - method: 'POST', - body: JSON.stringify({ - personalizations: [ - { - to: [{ email }], - subject: `${profile.firstName} ${profile.lastName} Thinks This Topcoder Gig Is For You!`, - }, - ], - from: { email: 'noreply@topcoder.com', name: `${profile.firstName} ${profile.lastName} via Topcoder Gigwork` }, - content: [{ - type: 'text/plain', value: `${formData.body}?referralId=${growSurf.data.id}`, - }], - }), - headers: { - 'Content-Type': 'application/json', - }, - redirect: 'follow', - }); - if (res.status >= 300) { - this.setState({ - isReferrError: await res.json(), - }); - // exit no email tracking due to the error - return; - } - // process sent log - let { emailInvitesLog, emailInvitesStatus } = growSurf.data.metadata; - if (!emailInvitesLog) emailInvitesLog = ''; - // check if email is in sent log alredy? - const foundInLog = emailInvitesLog.indexOf(email); - // only when email is new - put it in log, update counters and etc. - if (foundInLog === -1) { - // parse the log to array of emails - if (emailInvitesLog.length) { - emailInvitesLog = emailInvitesLog.split(','); - } else emailInvitesLog = []; - // prepare growSurf update payload - // we keep only 10 emails in the log to justify program rules - if (emailInvitesLog.length < 10) { - emailInvitesLog.push(email); - } - // Auto change status when 10 emails sent - if (emailInvitesLog.length === 10 && emailInvitesStatus !== 'Paid' && emailInvitesStatus !== 'Payment Pending') { - emailInvitesStatus = 'Payment Pending'; - } - // put the tracking update in growsurf - const updateRed = await fetch(`${PROXY_ENDPOINT}/growsurf/participant/${growSurf.data.id}`, { - method: 'PATCH', - headers: { - 'Content-Type': 'application/json', - Authorization: `Bearer ${tokenV3}`, - }, - body: JSON.stringify({ - ...growSurf.data, - metadata: { - ...growSurf.data.metadata, - emailInvitesSent: Number(growSurf.data.metadata.emailInvitesSent || 0) + 1, - emailInvitesLog: emailInvitesLog.join(), - emailInvitesStatus, - }, - }), - }); - if (updateRed.status >= 300) { - this.setState({ - isReferrError: await updateRed.json(), - }); - // exit no email tracking due to the error - // just notify the user about it - return; - } - } - // finally do: - this.setState({ - isReferrSucess: true, - }); - } - - /** - * Reset the form when referral done - */ - onReferralDone(refresh = false) { - if (refresh) { - window.location.reload(false); - return; - } - const { formData } = this.state; - delete formData.email; - this.setState({ - isReferrSucess: false, - isReferrError: false, - formData, - }); - } - render() { const { loading, @@ -186,15 +32,7 @@ ${config.URL.BASE}${config.GIGS_PAGES_PATH}/${props.id}`, isApply, application, profile, - growSurf, } = this.props; - const { - formErrors, - formData, - isReferrSucess, - isReferrError, - // referralId, - } = this.state; if (loading) { return ; @@ -207,13 +45,6 @@ ${config.URL.BASE}${config.GIGS_PAGES_PATH}/${props.id}`, job={job} application={application} profile={profile} - onSendClick={this.onSendClick} - isReferrSucess={isReferrSucess} - formErrors={formErrors} - formData={formData} - isReferrError={isReferrError} - onReferralDone={this.onReferralDone} - growSurf={growSurf} /> ); } @@ -223,8 +54,6 @@ RecruitCRMJobDetailsContainer.defaultProps = { job: {}, application: null, profile: {}, - growSurf: {}, - tokenV3: null, }; RecruitCRMJobDetailsContainer.propTypes = { @@ -235,21 +64,16 @@ RecruitCRMJobDetailsContainer.propTypes = { isApply: PT.bool.isRequired, application: PT.shape(), profile: PT.shape(), - growSurf: PT.shape(), - tokenV3: PT.string, }; function mapStateToProps(state, ownProps) { const data = state.recruitCRM[ownProps.id]; const profile = state.auth && state.auth.profile ? { ...state.auth.profile } : {}; - const { growSurf } = state; return { job: data ? data.job : {}, loading: data ? data.loading : true, application: data ? data.application : null, profile, - growSurf, - tokenV3: state.auth ? state.auth.tokenV3 : null, }; } diff --git a/src/shared/containers/GigsPages/index.jsx b/src/shared/containers/GigsPages/index.jsx index 757d3167e9..91a1081fa7 100644 --- a/src/shared/containers/GigsPages/index.jsx +++ b/src/shared/containers/GigsPages/index.jsx @@ -5,7 +5,6 @@ import React from 'react'; import PT from 'prop-types'; import Header from 'containers/TopcoderHeader'; import Footer from 'components/TopcoderFooter'; -import Viewport from 'components/Contentful/Viewport'; import { config, isomorphy } from 'topcoder-react-utils'; import RecruitCRMJobDetails from 'containers/Gigs/RecruitCRMJobDetails'; import { Helmet } from 'react-helmet'; @@ -15,9 +14,7 @@ import { connect } from 'react-redux'; import _ from 'lodash'; import { v4 as uuidv4 } from 'uuid'; import { getQuery } from 'utils/url'; -import ReferralCode from 'components/Gigs/ReferralCode'; import ChallengeTab from 'components/challenge-listing/ChallengeTab'; -import actions from 'actions/growSurf'; import './style.scss'; @@ -32,9 +29,6 @@ function GigsPagesContainer(props) { const { match, profile, - growSurf, - getReferralId, - tokenV3, history, location, } = props; @@ -46,12 +40,6 @@ function GigsPagesContainer(props) { optProfile.attributes.TC_Handle = profile.handle; optProfile.attributes.HomeCountryCode = profile.homeCountryCode; optProfile.attributes.email = profile.email; - // trigger referral id fetching when profile is loaded - if (isomorphy.isClientSide()) { - if (_.isEmpty(growSurf) || (!growSurf.loading && !growSurf.data && !growSurf.error)) { - getReferralId(profile, tokenV3); - } - } } else if (isomorphy.isClientSide()) { const idCookie = cookies.get('_tc.aid'); if (idCookie) { @@ -76,7 +64,7 @@ function GigsPagesContainer(props) { }), config.GROWSURF_COOKIE_SETTINGS); } } - const { id, type } = match.params; + const { id } = match.params; const isApply = `${config.GIGS_PAGES_PATH}/${id}/apply` === match.url; const title = 'Find Freelance Work | Gigs | Topcoder'; const description = 'Compete and build up your profiles and skills! Topcoder members become eligible to work on Gig Work projects by first proving themselves in various skill sets through Topcoder competitions.'; @@ -112,17 +100,6 @@ window._chatlio = window._chatlio||[]; /> ) : null } - { - !id && !type ? ( - - - - - ) : null - }
); @@ -141,8 +118,6 @@ window._chatlio = window._chatlio||[]; GigsPagesContainer.defaultProps = { profile: null, - growSurf: null, - tokenV3: null, }; GigsPagesContainer.propTypes = { @@ -153,32 +128,15 @@ GigsPagesContainer.propTypes = { history: PT.shape().isRequired, match: PT.shape().isRequired, profile: PT.shape(), - growSurf: PT.shape(), - getReferralId: PT.func.isRequired, - tokenV3: PT.string, }; function mapStateToProps(state) { const profile = state.auth && state.auth.profile ? { ...state.auth.profile } : {}; - const { growSurf } = state; return { profile, - growSurf, - tokenV3: state.auth ? state.auth.tokenV3 : null, - }; -} - -function mapDispatchToActions(dispatch) { - const a = actions.growsurf; - return { - getReferralId: (profile, tokenV3) => { - dispatch(a.getReferralidInit()); - dispatch(a.getReferralidDone(profile, tokenV3)); - }, }; } export default connect( mapStateToProps, - mapDispatchToActions, )(GigsPagesContainer); diff --git a/src/shared/reducers/growSurf.js b/src/shared/reducers/growSurf.js deleted file mode 100644 index 9ee65bb740..0000000000 --- a/src/shared/reducers/growSurf.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Reducer for state.growSurf - */ -import _ from 'lodash'; -import actions from 'actions/growSurf'; -import { handleActions } from 'redux-actions'; - -/** - * Handles getReferralIdInit action. - * @param {Object} state Previous state. - */ -function onInit(state, { payload }) { - return { - ...state, - ...payload, - }; -} - -/** - * Handles getReferralIdDone action. - * @param {Object} state Previous state. - * @param {Object} action The action. - */ -function onDone(state, { payload }) { - return { - ...state, - loading: false, - data: payload.data, - error: payload.error || false, - }; -} - -/** - * Creates mmleaderboard reducer with the specified initial state. - * @param {Object} state Optional. If not given, the default one is - * generated automatically. - * @return {Function} Reducer. - */ -function create(state = {}) { - return handleActions({ - [actions.growsurf.getReferralidInit]: onInit, - [actions.growsurf.getReferralidDone]: onDone, - }, _.defaults(state, { - loading: false, - })); -} - -/* Reducer with the default initial state. */ -export default create(); diff --git a/src/shared/reducers/index.js b/src/shared/reducers/index.js index a3172cc2a6..f5e9782065 100644 --- a/src/shared/reducers/index.js +++ b/src/shared/reducers/index.js @@ -43,7 +43,6 @@ import tcoLeaderboards from './tco/leaderboards'; import recruitCRM from './recruitCRM'; import gSheet from './gSheet'; import timelineWall from './timelineWall'; -import growSurf from './growSurf'; import thrive from './contentful/thrive'; import dashboard from './dashboard'; import blog from './blog'; @@ -181,7 +180,6 @@ export function factory(req) { recruitCRM, mmLeaderboard, gSheet, - growSurf, thrive, tcoLeaderboards, dashboard, From 2f23ed48b2b54227bd3d695ce9a515b3b8554b5c Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Wed, 24 Jul 2024 10:50:31 +0300 Subject: [PATCH 30/30] TOP-2194 bring back main viewport --- src/shared/containers/GigsPages/index.jsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/shared/containers/GigsPages/index.jsx b/src/shared/containers/GigsPages/index.jsx index 91a1081fa7..bcb33d4a4e 100644 --- a/src/shared/containers/GigsPages/index.jsx +++ b/src/shared/containers/GigsPages/index.jsx @@ -5,6 +5,7 @@ import React from 'react'; import PT from 'prop-types'; import Header from 'containers/TopcoderHeader'; import Footer from 'components/TopcoderFooter'; +import Viewport from 'components/Contentful/Viewport'; import { config, isomorphy } from 'topcoder-react-utils'; import RecruitCRMJobDetails from 'containers/Gigs/RecruitCRMJobDetails'; import { Helmet } from 'react-helmet'; @@ -64,7 +65,7 @@ function GigsPagesContainer(props) { }), config.GROWSURF_COOKIE_SETTINGS); } } - const { id } = match.params; + const { id, type } = match.params; const isApply = `${config.GIGS_PAGES_PATH}/${id}/apply` === match.url; const title = 'Find Freelance Work | Gigs | Topcoder'; const description = 'Compete and build up your profiles and skills! Topcoder members become eligible to work on Gig Work projects by first proving themselves in various skill sets through Topcoder competitions.'; @@ -100,6 +101,16 @@ window._chatlio = window._chatlio||[]; /> ) : null } + { + !id && !type ? ( + + + + ) : null + }
);