From b9cacbf7b646de0192bd7e74860c2f004b181c09 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 20 May 2024 09:35:26 +0300 Subject: [PATCH 1/9] ci: TOP-1390 on dev env --- .circleci/config.yml | 81 ++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3c07d6790..2a26df6d2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,37 +1,37 @@ version: 2.1 parameters: - run_basedeployment: - default: true - type: boolean - run_smoketesting: - default: false - type: boolean - run_performancetesting: - default: false - type: boolean + run_basedeployment: + default: true + type: boolean + run_smoketesting: + default: false + type: boolean + run_performancetesting: + default: false + type: boolean defaults: &defaults - docker: - - image: docker:20.10.21-git - environment: - ENV: $BASH_ENV + docker: + - image: docker:20.10.21-git + environment: + ENV: $BASH_ENV install_dependency: &install_dependency - name: Installation of build and deployment dependencies. - command: | - apk update - apk add --no-cache bash openssl curl - apk upgrade - apk add --no-cache jq py-pip sudo - sudo pip install awscli --upgrade + name: Installation of build and deployment dependencies. + command: | + apk update + apk add --no-cache bash openssl curl + apk upgrade + apk add --no-cache jq py-pip sudo + sudo pip install awscli --upgrade install_deploysuite: &install_deploysuite - name: Installation of install_deploysuite. - command: | - git clone --branch v1.4.14 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript - cp ./../buildscript/master_deploy.sh . - cp ./../buildscript/buildenv.sh . - cp ./../buildscript/awsconfiguration.sh . + name: Installation of install_deploysuite. + command: | + git clone --branch v1.4.14 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript + cp ./../buildscript/master_deploy.sh . + cp ./../buildscript/buildenv.sh . + cp ./../buildscript/awsconfiguration.sh . restore_cache_settings_for_build: &restore_cache_settings_for_build key: docker-node-modules-v3-{{ checksum "package-lock.json" }} @@ -41,11 +41,11 @@ save_cache_settings: &save_cache_settings - node_modules build_docker_image: &build_docker_image - name: Build of Docker image - command: | - source buildenvvar - ./build.sh - no_output_timeout: 20m + name: Build of Docker image + command: | + source buildenvvar + ./build.sh + no_output_timeout: 20m jobs: # Build & Deploy against development backend "build-dev": @@ -191,7 +191,7 @@ jobs: # command: | # source awsenvconf # source buildenvvar - # ./master_deploy.sh -d ECS -e PROD -t latest -s staging_communityapp_taskvar, -i communityapp + # ./master_deploy.sh -d ECS -e PROD -t latest -s staging_communityapp_taskvar, -i communityapp # curl --request POST \ # --url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \ # --header "Circle-Token: ${CIRCLE_TOKEN}" \ @@ -232,7 +232,7 @@ jobs: --data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_smoketesting":true , "run_performancetesting":false, "run_basedeployment": false}}' # Automated Smoke Testing against Staging - # Deprecate this workflow due to beta env shutdown + # Deprecate this workflow due to beta env shutdown # https://topcoder.atlassian.net/browse/CORE-202 # Smoke-Testing-On-Staging: # <<: *defaults @@ -259,7 +259,7 @@ jobs: # - store_artifacts: # path: ./automated-smoke-test/test-results - # Automated Smoke Testing against Production + # Automated Smoke Testing against Production Smoke-Testing-On-Production: <<: *defaults steps: @@ -330,9 +330,9 @@ jobs: # Download and cache dependencies - restore_cache: keys: - - v1-dependencies-{{ checksum "pom.xml" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- + - v1-dependencies-{{ checksum "pom.xml" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- - run: mvn dependency:go-offline @@ -353,11 +353,12 @@ workflows: jobs: # Development builds are executed on "new-develop" branch only. - "build-dev": - context : org-global + context: org-global filters: branches: only: - develop + - TOP-1390 # This is alternate dev env for parallel testing # Deprecate this workflow due to beta env shutdown # https://topcoder.atlassian.net/browse/CORE-251 @@ -402,7 +403,7 @@ workflows: # deployed on the production # master branch. - "build-prod": - context : org-global + context: org-global filters: &filters-prod branches: only: @@ -422,7 +423,7 @@ workflows: - Hold [Smoke-Testing]: type: approval - Smoke-Testing-On-Production: - context : org-global + context: org-global requires: - Hold [Smoke-Testing] filters: From 77a9279ad84d3417c056676a526d96d3afafa085 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 20 May 2024 10:01:19 +0300 Subject: [PATCH 2/9] TOP-1390 home refresh init --- .../components/Dashboard/BlogFeed/index.jsx | 45 ++++++------ .../components/Dashboard/BlogFeed/styles.scss | 36 +++++++--- .../components/Dashboard/Challenges/index.jsx | 50 ++++++++----- .../Dashboard/Challenges/styles.scss | 4 +- .../components/Dashboard/TCTime/index.jsx | 14 ++-- .../components/Dashboard/TCTime/light.scss | 29 ++++++++ .../Dashboard/ThriveArticlesFeed/index.jsx | 53 +++++++------- .../Dashboard/ThriveArticlesFeed/styles.scss | 35 +++++++--- src/shared/containers/Dashboard/index.jsx | 70 +++++++++++-------- .../containers/Dashboard/themes/light.scss | 34 +++++++++ 10 files changed, 245 insertions(+), 125 deletions(-) create mode 100644 src/shared/components/Dashboard/TCTime/light.scss create mode 100644 src/shared/containers/Dashboard/themes/light.scss diff --git a/src/shared/components/Dashboard/BlogFeed/index.jsx b/src/shared/components/Dashboard/BlogFeed/index.jsx index c808b3b69..1d7eb117e 100644 --- a/src/shared/components/Dashboard/BlogFeed/index.jsx +++ b/src/shared/components/Dashboard/BlogFeed/index.jsx @@ -2,45 +2,42 @@ * Blog Feed component */ -import LoadingIndicator from 'components/LoadingIndicator'; -import PT from 'prop-types'; -import React from 'react'; -import './styles.scss'; -import { config } from 'topcoder-react-utils'; -import BlogArticlesIcon from 'assets/images/icon-blog-articles.svg'; +import LoadingIndicator from "components/LoadingIndicator"; +import PT from "prop-types"; +import React from "react"; +import "./styles.scss"; +import { config } from "topcoder-react-utils"; -export default function BlogFeed({ - blogs, - loading, - theme, -}) { +export default function BlogFeed({ blogs, loading, theme }) { return (
- - BLOG ARTICLES + Blog Articles
View all + > + View all
- {loading ?
- : blogs.map(blog => ( + {loading ? ( +
+ +
+ ) : ( + blogs.map((blog) => (
- {blog.title} + + {blog.title}
- ))} + )) + )}
); @@ -48,11 +45,11 @@ export default function BlogFeed({ BlogFeed.defaultProps = { blogs: [], - theme: 'light', + theme: "light", }; BlogFeed.propTypes = { blogs: PT.arrayOf(PT.shape()), loading: PT.bool.isRequired, - theme: PT.oneOf(['dark', 'light']), + theme: PT.oneOf(["dark", "light"]), }; diff --git a/src/shared/components/Dashboard/BlogFeed/styles.scss b/src/shared/components/Dashboard/BlogFeed/styles.scss index 483ba5a12..91ec82e0b 100644 --- a/src/shared/components/Dashboard/BlogFeed/styles.scss +++ b/src/shared/components/Dashboard/BlogFeed/styles.scss @@ -18,7 +18,7 @@ color: $tc-gray-90; padding: 13px 12px 3px 12px; border-radius: 8px; - margin-bottom: 20px; + margin-bottom: 18px; } .header { @@ -28,18 +28,11 @@ padding-bottom: 10px; .title { - @include barlow-semi-bold; + @include roboto-bold; display: flex; font-size: 16px; align-items: center; - - .icon { - fill: $tc-gray-90; - width: 17px; - height: 17px; - margin-right: 9px; - } } .allLink { @@ -102,3 +95,28 @@ } } } + +.container.light { + color: #000; + background: #fff; + border: 1px solid #d4d4d4; + border-radius: 4px; + + .header { + .icon { + fill: $tc-white; + } + + .allLink { + color: #0d61bf; + font-size: 12px; + line-height: 20px; + } + } + + .blogs { + .row:not(:first-child) { + border-top: 1px solid $dashboard-dark-bg; + } + } +} diff --git a/src/shared/components/Dashboard/Challenges/index.jsx b/src/shared/components/Dashboard/Challenges/index.jsx index 4f2829228..183ef786a 100644 --- a/src/shared/components/Dashboard/Challenges/index.jsx +++ b/src/shared/components/Dashboard/Challenges/index.jsx @@ -1,12 +1,12 @@ -import _ from 'lodash'; -import LoadingIndicator from 'components/LoadingIndicator'; -import PT from 'prop-types'; -import React from 'react'; -import qs from 'qs'; +import _ from "lodash"; +import LoadingIndicator from "components/LoadingIndicator"; +import PT from "prop-types"; +import React from "react"; +import qs from "qs"; -import { config } from 'topcoder-react-utils'; +import { config } from "topcoder-react-utils"; -import './styles.scss'; +import "./styles.scss"; export default function ChallengesFeed({ challenges, @@ -21,15 +21,24 @@ export default function ChallengesFeed({ {title} View all challenges + > + View all challenges
- {loading ?
- : (challenges || []).map(challenge => ( + {loading ? ( +
+ +
+ ) : ( + (challenges || []).map((challenge) => (
- {`$${_.sum(challenge.prizeSets - .filter(set => set.type === 'placement') - .map(item => _.sum(item.prizes.map(prize => prize.value)))).toLocaleString()}`} + {`$${_.sum( + challenge.prizeSets + .filter((set) => set.type === "placement") + .map((item) => + _.sum(item.prizes.map((prize) => prize.value)) + ) + ).toLocaleString()}`}
- ))} + )) + )}
) : null; @@ -54,15 +68,15 @@ export default function ChallengesFeed({ ChallengesFeed.defaultProps = { challenges: [], - theme: 'light', - title: 'CHALLENGES', + theme: "light", + title: "Opportunities", challengeListingQuery: undefined, }; ChallengesFeed.propTypes = { challenges: PT.arrayOf(PT.shape()), loading: PT.bool.isRequired, - theme: PT.oneOf(['dark', 'light']), + theme: PT.oneOf(["dark", "light"]), title: PT.string, challengeListingQuery: PT.shape(), }; diff --git a/src/shared/components/Dashboard/Challenges/styles.scss b/src/shared/components/Dashboard/Challenges/styles.scss index aa3e21ff4..4521a6e4c 100644 --- a/src/shared/components/Dashboard/Challenges/styles.scss +++ b/src/shared/components/Dashboard/Challenges/styles.scss @@ -31,9 +31,9 @@ $dashboard-dark-bg: #2a2a2a; padding: 12px 0; .title { - @include barlow-semi-bold; + @include roboto-bold; - font-size: 16px; + font-size: 20px; } .allLink { diff --git a/src/shared/components/Dashboard/TCTime/index.jsx b/src/shared/components/Dashboard/TCTime/index.jsx index adb3f8bd6..79377e9ba 100644 --- a/src/shared/components/Dashboard/TCTime/index.jsx +++ b/src/shared/components/Dashboard/TCTime/index.jsx @@ -1,18 +1,20 @@ /** * Topcoder Time Component */ -import React, { useState, useEffect } from 'react'; -import moment from 'moment-timezone'; -import darkTheme from './dark.scss'; +import React, { useState, useEffect } from "react"; +import moment from "moment-timezone"; +import darkTheme from "./dark.scss"; +import lightTheme from "./light.scss"; const THEMES = { dark: darkTheme, + light: lightTheme, }; function TopcoderTime() { - const theme = THEMES.dark; // for v1 only dark theme - let FORMAT = 'MMM Do, HH:mm UTC'; - const TIMEZONE = 'America/New_York'; + const theme = THEMES.light; + let FORMAT = "MMM Do, HH:mm UTC"; + const TIMEZONE = "America/New_York"; const now = moment.tz(new Date(), TIMEZONE); FORMAT += now.utcOffset() / 60; const [tcTime, setTCTime] = useState(`${now.format(FORMAT)}`); diff --git a/src/shared/components/Dashboard/TCTime/light.scss b/src/shared/components/Dashboard/TCTime/light.scss new file mode 100644 index 000000000..87329b56e --- /dev/null +++ b/src/shared/components/Dashboard/TCTime/light.scss @@ -0,0 +1,29 @@ +@import "~styles/mixins"; + +.container { + display: flex; + flex-direction: column; + padding: 12px; + margin-bottom: 18px; + + @media screen and (max-width: 425px) { + flex-direction: row; + justify-content: space-between; + align-items: center; + } + + .title { + color: #000; + font-size: 16px; + font-family: Roboto, sans-serif; + font-weight: bold; + line-height: 24px; + } + + .time { + color: #000; + font-size: 16px; + font-family: Roboto, sans-serif; + line-height: 24px; + } +} diff --git a/src/shared/components/Dashboard/ThriveArticlesFeed/index.jsx b/src/shared/components/Dashboard/ThriveArticlesFeed/index.jsx index 89bff6afa..f5a1a8818 100644 --- a/src/shared/components/Dashboard/ThriveArticlesFeed/index.jsx +++ b/src/shared/components/Dashboard/ThriveArticlesFeed/index.jsx @@ -2,44 +2,45 @@ * Thrive Articles Feed component */ -import LoadingIndicator from 'components/LoadingIndicator'; -import PT from 'prop-types'; -import React from 'react'; -import './styles.scss'; -import ThriveArticlesIcon from 'assets/images/thrive-articles.svg'; +import LoadingIndicator from "components/LoadingIndicator"; +import PT from "prop-types"; +import React from "react"; +import "./styles.scss"; -export default function ThriveArticlesFeed({ - articles, - loading, - theme, -}) { +export default function ThriveArticlesFeed({ articles, loading, theme }) { return (
- - THRIVE ARTICLES + Thrive Articles
-
View all + + View all
- {loading ?
- : articles.map(article => ( -
+ {loading ? ( +
+ +
+ ) : ( + articles.map((article) => ( + - ))} + )) + )}
); @@ -47,11 +48,11 @@ export default function ThriveArticlesFeed({ ThriveArticlesFeed.defaultProps = { articles: [], - theme: 'light', + theme: "light", }; ThriveArticlesFeed.propTypes = { articles: PT.arrayOf(PT.shape()), loading: PT.bool.isRequired, - theme: PT.oneOf(['dark', 'light']), + theme: PT.oneOf(["dark", "light"]), }; diff --git a/src/shared/components/Dashboard/ThriveArticlesFeed/styles.scss b/src/shared/components/Dashboard/ThriveArticlesFeed/styles.scss index 7ee6fb659..4a62b1b71 100644 --- a/src/shared/components/Dashboard/ThriveArticlesFeed/styles.scss +++ b/src/shared/components/Dashboard/ThriveArticlesFeed/styles.scss @@ -28,19 +28,11 @@ padding-bottom: 10px; .title { - @include barlow-semi-bold; + @include roboto-bold; display: flex; font-size: 16px; align-items: center; - - .icon { - fill: $tc-gray-90; - width: 17px; - height: 17px; - margin-right: 9px; - margin-bottom: 3px; - } } .allLink { @@ -103,3 +95,28 @@ } } } + +.container.light { + color: #000; + background: #fff; + border: 1px solid #d4d4d4; + border-radius: 4px; + + .header { + .icon { + fill: $tc-white; + } + + .allLink { + color: #0d61bf; + font-size: 12px; + line-height: 20px; + } + } + + .articles { + .row:not(:first-child) { + border-top: 1px solid #e9e9e9; + } + } +} diff --git a/src/shared/containers/Dashboard/index.jsx b/src/shared/containers/Dashboard/index.jsx index 3174510f9..96ff2f0c7 100644 --- a/src/shared/containers/Dashboard/index.jsx +++ b/src/shared/containers/Dashboard/index.jsx @@ -5,32 +5,35 @@ /** * SlashTC index container */ -import React, { useEffect } from 'react'; -import PT from 'prop-types'; -import { connect } from 'react-redux'; -import { useMediaQuery } from 'react-responsive'; -import { isTokenExpired } from '@topcoder-platform/tc-auth-lib'; -import { config } from 'topcoder-react-utils'; -import Viewport from 'components/Contentful/Viewport'; -import TopcoderTime from 'components/Dashboard/TCTime'; -import ThriveArticlesFeedContainer from 'containers/Dashboard/ThriveArticlesFeed'; +import React, { useEffect } from "react"; +import PT from "prop-types"; +import { connect } from "react-redux"; +import { useMediaQuery } from "react-responsive"; +import { isTokenExpired } from "@topcoder-platform/tc-auth-lib"; +import { config } from "topcoder-react-utils"; +import Viewport from "components/Contentful/Viewport"; +import TopcoderTime from "components/Dashboard/TCTime"; +import ThriveArticlesFeedContainer from "containers/Dashboard/ThriveArticlesFeed"; // deprecated with https://topcoder.atlassian.net/browse/CORE-346 // import GigsFeed from 'containers/Dashboard/GigsFeed'; -import ChallengesFeed from 'containers/Dashboard/ChallengesFeed'; -import BlogFeedContainer from 'containers/Dashboard/BlogFeed'; -import MetaTags from 'components/MetaTags'; -import NewsFeed from './NewsFeed'; -import darkTheme from './themes/dark.scss'; +import ChallengesFeed from "containers/Dashboard/ChallengesFeed"; +import BlogFeedContainer from "containers/Dashboard/BlogFeed"; +import MetaTags from "components/MetaTags"; +// deprecated with https://topcoder.atlassian.net/browse/TOP-1390 +// import NewsFeed from './NewsFeed'; +import darkTheme from "./themes/dark.scss"; +import lightTheme from "./themes/light.scss"; const THEMES = { dark: darkTheme, + light: lightTheme, }; const { INNOVATION_CHALLENGES_TAG } = config; function SlashTCContainer(props) { - const theme = THEMES.dark; // for v1 only dark theme + const theme = THEMES.light; const isTabletOrMobile = useMediaQuery({ maxWidth: 768 }); - const title = 'Home | Topcoder'; + const title = "Home | Topcoder"; const challengeListingQuery = { search: INNOVATION_CHALLENGES_TAG, isInnovationChallenge: true, @@ -45,9 +48,7 @@ function SlashTCContainer(props) { return (
- + { // Render different stacking of components for tables&mobile devices isTabletOrMobile ? ( @@ -55,6 +56,10 @@ function SlashTCContainer(props) {
+ - {/* deprected with https://topcoder.atlassian.net/browse/CORE-346 */} {/* */} - + {/* deprecated with https://topcoder.atlassian.net/browse/TOP-1390 */} + {/* */} - - + +
@@ -78,13 +83,17 @@ function SlashTCContainer(props) { {/* Left column */}
- - + +
{/* Center column */}
+ - {/* deprected with https://topcoder.atlassian.net/browse/CORE-346 */} {/* */} - + {/* deprecated with https://topcoder.atlassian.net/browse/TOP-1390 */} + {/* */}
{/* Right column */}
@@ -120,13 +129,12 @@ SlashTCContainer.propTypes = { }; function mapStateToProps(state) { - const profile = state.auth && state.auth.profile ? { ...state.auth.profile } : {}; + const profile = + state.auth && state.auth.profile ? { ...state.auth.profile } : {}; return { profile, tokenV3: state.auth.tokenV3, }; } -export default connect( - mapStateToProps, -)(SlashTCContainer); +export default connect(mapStateToProps)(SlashTCContainer); diff --git a/src/shared/containers/Dashboard/themes/light.scss b/src/shared/containers/Dashboard/themes/light.scss new file mode 100644 index 000000000..dfb44c760 --- /dev/null +++ b/src/shared/containers/Dashboard/themes/light.scss @@ -0,0 +1,34 @@ +@import "~styles/mixins"; + +.container { + background-color: #f9f9f9; + padding-top: 46px; + padding-bottom: 80px; + width: 100%; + + @media screen and (max-width: 1280px) { + padding-left: 15px; + padding-right: 15px; + } + + @media screen and (max-width: 768px) { + padding-bottom: 30px; + } + + .layoutWrapper { + display: grid; + gap: 44px; + grid-template-columns: 260px 1fr 260px; + margin: auto; + max-width: 1280px; + + @media screen and (max-width: 1024px) { + grid-template-columns: 1fr; + } + + .column { + display: flex; + flex-direction: column; + } + } +} From 7085fa105d6f72c69f99cc58f6e7ecee5280888d Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 20 May 2024 10:16:59 +0300 Subject: [PATCH 3/9] TOP-1390 fix lint errors --- .../components/Dashboard/BlogFeed/index.jsx | 27 +++++++++------ .../components/Dashboard/Challenges/index.jsx | 30 ++++++++--------- .../components/Dashboard/TCTime/index.jsx | 12 +++---- .../Dashboard/ThriveArticlesFeed/index.jsx | 14 ++++---- src/shared/containers/Dashboard/index.jsx | 33 +++++++++---------- 5 files changed, 60 insertions(+), 56 deletions(-) diff --git a/src/shared/components/Dashboard/BlogFeed/index.jsx b/src/shared/components/Dashboard/BlogFeed/index.jsx index 1d7eb117e..48a0c0cf7 100644 --- a/src/shared/components/Dashboard/BlogFeed/index.jsx +++ b/src/shared/components/Dashboard/BlogFeed/index.jsx @@ -2,11 +2,11 @@ * Blog Feed component */ -import LoadingIndicator from "components/LoadingIndicator"; -import PT from "prop-types"; -import React from "react"; -import "./styles.scss"; -import { config } from "topcoder-react-utils"; +import LoadingIndicator from 'components/LoadingIndicator'; +import PT from 'prop-types'; +import React from 'react'; +import './styles.scss'; +import { config } from 'topcoder-react-utils'; export default function BlogFeed({ blogs, loading, theme }) { return ( @@ -30,9 +30,16 @@ export default function BlogFeed({ blogs, loading, theme }) {
) : ( - blogs.map((blog) => ( -
- + blogs.map(blog => ( +
+ {blog.title}
@@ -45,11 +52,11 @@ export default function BlogFeed({ blogs, loading, theme }) { BlogFeed.defaultProps = { blogs: [], - theme: "light", + theme: 'light', }; BlogFeed.propTypes = { blogs: PT.arrayOf(PT.shape()), loading: PT.bool.isRequired, - theme: PT.oneOf(["dark", "light"]), + theme: PT.oneOf(['dark', 'light']), }; diff --git a/src/shared/components/Dashboard/Challenges/index.jsx b/src/shared/components/Dashboard/Challenges/index.jsx index 183ef786a..719832cfb 100644 --- a/src/shared/components/Dashboard/Challenges/index.jsx +++ b/src/shared/components/Dashboard/Challenges/index.jsx @@ -1,12 +1,12 @@ -import _ from "lodash"; -import LoadingIndicator from "components/LoadingIndicator"; -import PT from "prop-types"; -import React from "react"; -import qs from "qs"; +import _ from 'lodash'; +import LoadingIndicator from 'components/LoadingIndicator'; +import PT from 'prop-types'; +import React from 'react'; +import qs from 'qs'; -import { config } from "topcoder-react-utils"; +import { config } from 'topcoder-react-utils'; -import "./styles.scss"; +import './styles.scss'; export default function ChallengesFeed({ challenges, @@ -24,7 +24,7 @@ export default function ChallengesFeed({ href={`${config.URL.CHALLENGES_URL}${ challengeListingQuery ? `?${qs.stringify(challengeListingQuery)}` - : "" + : '' }`} target="_blank" rel="noreferrer" @@ -38,7 +38,7 @@ export default function ChallengesFeed({
) : ( - (challenges || []).map((challenge) => ( + (challenges || []).map(challenge => (
{`$${_.sum( challenge.prizeSets - .filter((set) => set.type === "placement") - .map((item) => - _.sum(item.prizes.map((prize) => prize.value)) - ) + .filter(set => set.type === 'placement') + .map(item => _.sum(item.prizes.map(prize => prize.value))), ).toLocaleString()}`}
@@ -68,15 +66,15 @@ export default function ChallengesFeed({ ChallengesFeed.defaultProps = { challenges: [], - theme: "light", - title: "Opportunities", + theme: 'light', + title: 'Opportunities', challengeListingQuery: undefined, }; ChallengesFeed.propTypes = { challenges: PT.arrayOf(PT.shape()), loading: PT.bool.isRequired, - theme: PT.oneOf(["dark", "light"]), + theme: PT.oneOf(['dark', 'light']), title: PT.string, challengeListingQuery: PT.shape(), }; diff --git a/src/shared/components/Dashboard/TCTime/index.jsx b/src/shared/components/Dashboard/TCTime/index.jsx index 79377e9ba..aab9e8947 100644 --- a/src/shared/components/Dashboard/TCTime/index.jsx +++ b/src/shared/components/Dashboard/TCTime/index.jsx @@ -1,10 +1,10 @@ /** * Topcoder Time Component */ -import React, { useState, useEffect } from "react"; -import moment from "moment-timezone"; -import darkTheme from "./dark.scss"; -import lightTheme from "./light.scss"; +import React, { useState, useEffect } from 'react'; +import moment from 'moment-timezone'; +import darkTheme from './dark.scss'; +import lightTheme from './light.scss'; const THEMES = { dark: darkTheme, @@ -13,8 +13,8 @@ const THEMES = { function TopcoderTime() { const theme = THEMES.light; - let FORMAT = "MMM Do, HH:mm UTC"; - const TIMEZONE = "America/New_York"; + let FORMAT = 'MMM Do, HH:mm UTC'; + const TIMEZONE = 'America/New_York'; const now = moment.tz(new Date(), TIMEZONE); FORMAT += now.utcOffset() / 60; const [tcTime, setTCTime] = useState(`${now.format(FORMAT)}`); diff --git a/src/shared/components/Dashboard/ThriveArticlesFeed/index.jsx b/src/shared/components/Dashboard/ThriveArticlesFeed/index.jsx index f5a1a8818..b80341e07 100644 --- a/src/shared/components/Dashboard/ThriveArticlesFeed/index.jsx +++ b/src/shared/components/Dashboard/ThriveArticlesFeed/index.jsx @@ -2,10 +2,10 @@ * Thrive Articles Feed component */ -import LoadingIndicator from "components/LoadingIndicator"; -import PT from "prop-types"; -import React from "react"; -import "./styles.scss"; +import LoadingIndicator from 'components/LoadingIndicator'; +import PT from 'prop-types'; +import React from 'react'; +import './styles.scss'; export default function ThriveArticlesFeed({ articles, loading, theme }) { return ( @@ -24,7 +24,7 @@ export default function ThriveArticlesFeed({ articles, loading, theme }) {
) : ( - articles.map((article) => ( + articles.map(article => (
Date: Mon, 20 May 2024 11:09:12 +0300 Subject: [PATCH 4/9] TOP-1390 dev viewports and styling --- .../components/Dashboard/BlogFeed/styles.scss | 1 + .../components/Dashboard/Challenges/index.jsx | 2 +- .../Dashboard/Challenges/styles.scss | 37 +++++++++++++++++++ .../containers/Dashboard/ChallengesFeed.jsx | 2 +- src/shared/containers/Dashboard/index.jsx | 23 ++++++------ 5 files changed, 52 insertions(+), 13 deletions(-) diff --git a/src/shared/components/Dashboard/BlogFeed/styles.scss b/src/shared/components/Dashboard/BlogFeed/styles.scss index 91ec82e0b..46a04c6e4 100644 --- a/src/shared/components/Dashboard/BlogFeed/styles.scss +++ b/src/shared/components/Dashboard/BlogFeed/styles.scss @@ -111,6 +111,7 @@ color: #0d61bf; font-size: 12px; line-height: 20px; + text-decoration: none; } } diff --git a/src/shared/components/Dashboard/Challenges/index.jsx b/src/shared/components/Dashboard/Challenges/index.jsx index 719832cfb..bbc8d9d00 100644 --- a/src/shared/components/Dashboard/Challenges/index.jsx +++ b/src/shared/components/Dashboard/Challenges/index.jsx @@ -29,7 +29,7 @@ export default function ChallengesFeed({ target="_blank" rel="noreferrer" > - View all challenges + View all
diff --git a/src/shared/components/Dashboard/Challenges/styles.scss b/src/shared/components/Dashboard/Challenges/styles.scss index 4521a6e4c..ae74c8ea0 100644 --- a/src/shared/components/Dashboard/Challenges/styles.scss +++ b/src/shared/components/Dashboard/Challenges/styles.scss @@ -125,3 +125,40 @@ $dashboard-dark-bg: #2a2a2a; } } } + +.container.light { + color: $tc-white; + + .header { + padding: 19px 0; + + .title { + color: #2a2a2a; + } + + .allLink { + color: #fff; + border-radius: 4px; + background-color: #0d61bf; + font-size: 14px; + font-weight: 500; + line-height: 22px; + padding: 1px 12px; + } + } + + .challenges { + background-color: transparent; + border-radius: 0; + color: #2a2a2a; + + .row { + background-color: #fff; + border: 1px solid #d4d4d4; + margin: 0; + margin-bottom: 10px; + border-radius: 4px; + padding: 11px 15px; + } + } +} \ No newline at end of file diff --git a/src/shared/containers/Dashboard/ChallengesFeed.jsx b/src/shared/containers/Dashboard/ChallengesFeed.jsx index 5e9ed2aef..f6ccd0d7c 100644 --- a/src/shared/containers/Dashboard/ChallengesFeed.jsx +++ b/src/shared/containers/Dashboard/ChallengesFeed.jsx @@ -74,7 +74,7 @@ ChallengesFeedContainer.defaultProps = { includeAllTags: false, projectId: null, excludeTags: [], - title: 'CHALLENGES', + title: 'Opportunities', challengeListingQuery: undefined, tracks: ['DES', 'DEV', 'DS', 'QA'], }; diff --git a/src/shared/containers/Dashboard/index.jsx b/src/shared/containers/Dashboard/index.jsx index a8b26a5d3..6382c5dc2 100644 --- a/src/shared/containers/Dashboard/index.jsx +++ b/src/shared/containers/Dashboard/index.jsx @@ -5,7 +5,7 @@ /** * SlashTC index container */ -import React, { useEffect } from 'react'; +import React, { useEffect, useMemo } from 'react'; import PT from 'prop-types'; import { connect } from 'react-redux'; import { useMediaQuery } from 'react-responsive'; @@ -38,6 +38,7 @@ function SlashTCContainer(props) { search: INNOVATION_CHALLENGES_TAG, isInnovationChallenge: true, }; + const isDevEnv = useMemo(() => config.URL.BASE.includes('-dev'), []); useEffect(() => { if (props.tokenV3 && !isTokenExpired(props.tokenV3)) return; @@ -55,13 +56,13 @@ function SlashTCContainer(props) {
- + { isDevEnv ? : } */} {/* deprecated with https://topcoder.atlassian.net/browse/TOP-1390 */} {/* */} - + { isDevEnv ? : } - + { isDevEnv ? : }
) : ( @@ -85,17 +86,17 @@ function SlashTCContainer(props) { - + { isDevEnv ? : }
{/* Center column */}
- + { isDevEnv ? : } {/* Right column */}
- + { isDevEnv ? : }
) From 5b31f94565f3dcfd2f2b9760eba3704951993521 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 20 May 2024 11:17:16 +0300 Subject: [PATCH 5/9] TOP-1390 fix lint errors --- src/shared/components/Dashboard/Challenges/styles.scss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shared/components/Dashboard/Challenges/styles.scss b/src/shared/components/Dashboard/Challenges/styles.scss index ae74c8ea0..f673a0fcd 100644 --- a/src/shared/components/Dashboard/Challenges/styles.scss +++ b/src/shared/components/Dashboard/Challenges/styles.scss @@ -131,7 +131,7 @@ $dashboard-dark-bg: #2a2a2a; .header { padding: 19px 0; - + .title { color: #2a2a2a; } @@ -152,6 +152,7 @@ $dashboard-dark-bg: #2a2a2a; border-radius: 0; color: #2a2a2a; + // eslint-disable-next-line no-descending-specificity .row { background-color: #fff; border: 1px solid #d4d4d4; @@ -161,4 +162,4 @@ $dashboard-dark-bg: #2a2a2a; padding: 11px 15px; } } -} \ No newline at end of file +} From 9cef4241275c2a0159c5ab4bb9a0fee03761c7c1 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 20 May 2024 11:22:28 +0300 Subject: [PATCH 6/9] TOP-1390 fix lint rules order --- src/shared/components/Dashboard/Challenges/styles.scss | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/shared/components/Dashboard/Challenges/styles.scss b/src/shared/components/Dashboard/Challenges/styles.scss index f673a0fcd..bc69ef8e2 100644 --- a/src/shared/components/Dashboard/Challenges/styles.scss +++ b/src/shared/components/Dashboard/Challenges/styles.scss @@ -120,9 +120,9 @@ $dashboard-dark-bg: #2a2a2a; .challenges { background-color: $dashboard-dark-card-bg; - .row:not(:first-child) { - border-top: 1px solid $dashboard-dark-bg; - } + // .row:not(:first-child) { + // border-top: 1px solid $dashboard-dark-bg; + // } } } @@ -152,7 +152,6 @@ $dashboard-dark-bg: #2a2a2a; border-radius: 0; color: #2a2a2a; - // eslint-disable-next-line no-descending-specificity .row { background-color: #fff; border: 1px solid #d4d4d4; From dc8e9c61bcf10047179817b222b7b0528e33e731 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 20 May 2024 11:54:46 +0300 Subject: [PATCH 7/9] TOP-1390 fix redux key name --- src/shared/containers/Dashboard/ChallengesFeed.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/containers/Dashboard/ChallengesFeed.jsx b/src/shared/containers/Dashboard/ChallengesFeed.jsx index f6ccd0d7c..acbc70791 100644 --- a/src/shared/containers/Dashboard/ChallengesFeed.jsx +++ b/src/shared/containers/Dashboard/ChallengesFeed.jsx @@ -96,7 +96,7 @@ ChallengesFeedContainer.propTypes = { function mapStateToProps(state, ownProps) { const { dashboard } = state; - const id = ownProps.title || 'CHALLENGES'; + const id = ownProps.title || 'Opportunities'; if (dashboard[id]) { return { From de8f4dc673ad6d60b3ea497c6078b78c1890b000 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 20 May 2024 12:07:47 +0300 Subject: [PATCH 8/9] TOP-1390 rename IC section title --- src/shared/containers/Dashboard/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/containers/Dashboard/index.jsx b/src/shared/containers/Dashboard/index.jsx index 6382c5dc2..7c38602c2 100644 --- a/src/shared/containers/Dashboard/index.jsx +++ b/src/shared/containers/Dashboard/index.jsx @@ -97,7 +97,7 @@ function SlashTCContainer(props) { /> Date: Mon, 20 May 2024 12:27:02 +0300 Subject: [PATCH 9/9] TOP-1390 remove margin on challenges feed --- src/shared/components/Dashboard/Challenges/styles.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shared/components/Dashboard/Challenges/styles.scss b/src/shared/components/Dashboard/Challenges/styles.scss index bc69ef8e2..da91e7b53 100644 --- a/src/shared/components/Dashboard/Challenges/styles.scss +++ b/src/shared/components/Dashboard/Challenges/styles.scss @@ -128,6 +128,7 @@ $dashboard-dark-bg: #2a2a2a; .container.light { color: $tc-white; + margin-bottom: 0; .header { padding: 19px 0;