diff --git a/.circleci/config.yml b/.circleci/config.yml index 62b48152fc..ab9d75fe91 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -356,7 +356,7 @@ workflows: filters: branches: only: - - tco23 + - free # This is alternate dev env for parallel testing - "build-qa": context : org-global @@ -370,7 +370,6 @@ workflows: filters: branches: only: - - footer-update - reskin-profile # This is stage env for production QA releases - "build-prod-staging": @@ -380,6 +379,7 @@ workflows: only: - develop - fix-security-headers + - tco23-BS-comps # Production builds are exectuted # when PR is merged to the master # Don't change anything in this configuration diff --git a/__tests__/shared/components/Leaderboard/__snapshots__/LeaderboardTable.jsx.snap b/__tests__/shared/components/Leaderboard/__snapshots__/LeaderboardTable.jsx.snap index 3bf6fc11dd..be1a732415 100644 --- a/__tests__/shared/components/Leaderboard/__snapshots__/LeaderboardTable.jsx.snap +++ b/__tests__/shared/components/Leaderboard/__snapshots__/LeaderboardTable.jsx.snap @@ -36,7 +36,9 @@ exports[`Matches shallow shapshot 1`] = ` - 1 + + 1 + - challenges + undefined challenges @@ -88,7 +91,9 @@ exports[`Matches shallow shapshot 1`] = ` - 1 + + 1 + - challenges + undefined challenges @@ -140,7 +146,9 @@ exports[`Matches shallow shapshot 1`] = ` - 1 + + 1 + - challenges + undefined challenges @@ -192,7 +201,9 @@ exports[`Matches shallow shapshot 1`] = ` - 1 + + 1 + - challenges + undefined challenges diff --git a/__tests__/shared/components/Leaderboard/__snapshots__/Podium.jsx.snap b/__tests__/shared/components/Leaderboard/__snapshots__/Podium.jsx.snap index 09459e245f..c5a8a3f5e5 100644 --- a/__tests__/shared/components/Leaderboard/__snapshots__/Podium.jsx.snap +++ b/__tests__/shared/components/Leaderboard/__snapshots__/Podium.jsx.snap @@ -2,10 +2,10 @@ exports[`Matches shallow shapshot 1`] = `
diff --git a/src/shared/components/Contentful/Tabs/themes/underline.scss b/src/shared/components/Contentful/Tabs/themes/underline.scss index 5dc5689b77..a10e14c21d 100644 --- a/src/shared/components/Contentful/Tabs/themes/underline.scss +++ b/src/shared/components/Contentful/Tabs/themes/underline.scss @@ -8,7 +8,7 @@ $text-color-pannel: #4a4a4a; .container { @include roboto-regular; - max-width: $screen-md; + max-width: $screen-lg; margin: auto; } @@ -98,6 +98,6 @@ $text-color-pannel: #4a4a4a; display: block; @include xs-to-sm { - padding: 0 15px; + // padding: 0 15px; } } diff --git a/src/shared/components/Contentful/_brackets.scss b/src/shared/components/Contentful/_brackets.scss index db13a3a911..b4143afc5d 100644 --- a/src/shared/components/Contentful/_brackets.scss +++ b/src/shared/components/Contentful/_brackets.scss @@ -154,6 +154,10 @@ color: #0d61bf; text-decoration: none; + @include sm { + text-decoration: underline; + } + &:hover { text-decoration: none; color: #0d61bf; diff --git a/src/shared/components/Leaderboard/ChallengeHistoryModal/index.jsx b/src/shared/components/Leaderboard/ChallengeHistoryModal/index.jsx index f71e7a0de4..bd4023d261 100644 --- a/src/shared/components/Leaderboard/ChallengeHistoryModal/index.jsx +++ b/src/shared/components/Leaderboard/ChallengeHistoryModal/index.jsx @@ -5,9 +5,16 @@ import LoadingIndicator from 'components/LoadingIndicator'; import { config } from 'topcoder-react-utils'; import cn from 'classnames'; import _ from 'lodash'; -import theme from './styles.scss'; import PodiumSpot from '../PodiumSpot'; +import defaultTheme from './themes/styles.scss'; +import tco23Theme from './themes/tco23.scss'; + +const THEMES = { + Default: defaultTheme, + TCO23: tco23Theme, +}; + class ChallengeHistoryModal extends Component { constructor(props) { super(props); @@ -34,13 +41,31 @@ class ChallengeHistoryModal extends Component { const challengesOrdered = _.orderBy(challenges, [sortParam.field], [sortParam.order]); const placeLabel = competitor['member_profile_basic.handle'] ? 'tco_leaderboard.placement' : 'place'; const pointsLabel = competitor['member_profile_basic.handle'] ? 'tco_leaderboard.tco_points' : 'points'; + const styles = THEMES[themeName] || THEMES.Default; + /* eslint-disable no-confusing-arrow */ + const sortInner = () => themeName === 'TCO23' ? ( + + + + ) : ( +
+
+
+
+ ); return ( - +

Completed Challenges History

-
+
- +
{ !isCopilot ? ( ) : null } @@ -115,19 +126,19 @@ class ChallengeHistoryModal extends Component { { challengesOrdered.map(challenge => ( - - + { !isCopilot ? ( - + ) : null } - )) @@ -142,8 +153,8 @@ class ChallengeHistoryModal extends Component {
No data available.
) } -
-
diff --git a/src/shared/components/Leaderboard/ChallengeHistoryModal/styles.scss b/src/shared/components/Leaderboard/ChallengeHistoryModal/themes/styles.scss similarity index 95% rename from src/shared/components/Leaderboard/ChallengeHistoryModal/styles.scss rename to src/shared/components/Leaderboard/ChallengeHistoryModal/themes/styles.scss index bfae5ccc70..277803f851 100644 --- a/src/shared/components/Leaderboard/ChallengeHistoryModal/styles.scss +++ b/src/shared/components/Leaderboard/ChallengeHistoryModal/themes/styles.scss @@ -123,6 +123,17 @@ $light-gray: #d4d4d4; font-weight: 400; line-height: 51px; } + + .placement, + .points { + @include sm { + text-align: center; + } + + span { + display: none; + } + } } } diff --git a/src/shared/components/Leaderboard/ChallengeHistoryModal/themes/tco23.scss b/src/shared/components/Leaderboard/ChallengeHistoryModal/themes/tco23.scss new file mode 100644 index 0000000000..9a879d9dd7 --- /dev/null +++ b/src/shared/components/Leaderboard/ChallengeHistoryModal/themes/tco23.scss @@ -0,0 +1,230 @@ +/* stylelint-disable no-descending-specificity */ +@import "~styles/mixins"; + +$light-gray: #d4d4d4; + +.container { + @include roboto-regular; + + color: $tc-gray-50; + background: $tc-white; + border-radius: 10px; + top: 50%; + width: 70%; + max-height: 90%; + overflow-y: auto; + padding: 32px 32px 64px; + + @media (max-width: 768px) { + width: 90%; + padding: 26px 16px 32px; + } + + h3 { + color: #2a2a2a; + font-family: Barlow, sans-serif; + font-size: 22px; + font-weight: 600; + line-height: 26px; + padding-bottom: 24px; + text-transform: uppercase; + border-bottom: 1px solid #e9e9e9; + margin-bottom: 24px; + + @media (max-width: 768px) { + font-size: 18px !important; + line-height: 20px !important; + padding-bottom: 18px; + margin-bottom: 16px; + } + } +} + +.overlay { + background-color: #2a2a2a; + opacity: 0.95; + border: none; + height: 100%; + left: 0; + outline: none; + position: fixed; + top: 0; + width: 100%; + z-index: 998; +} + +.podium-spot-wrapper { + text-align: center; + display: flex; + justify-content: center; + margin-bottom: 50px; + + > div > span { + height: 128px; + width: 128px; + + img, + svg { + border-radius: 50%; + height: 100%; + width: 100%; + } + } +} + +.history-table { + width: 100%; + margin-bottom: 62px; + + thead { + @include sm { + display: none; + } + + th { + color: #767676; + font-family: Barlow, sans-serif; + font-size: 11px; + font-weight: 600; + text-transform: uppercase; + text-align: left; + line-height: 14px; + padding-bottom: 18px; + } + } + + .row { + height: 56px; + + @include sm { + display: flex; + flex-direction: column; + height: auto; + padding: 16px; + width: calc(100vw - 78px); + border-radius: 8px; + background-color: #f4f4f4; + margin-bottom: 8px; + } + + &:nth-child(odd) { + background-color: #f4f4f4; + + td:first-child { + border-top-left-radius: 8px; + border-bottom-left-radius: 8px; + } + + td:last-child { + border-top-right-radius: 8px; + border-bottom-right-radius: 8px; + } + } + + td { + vertical-align: middle; + + &:first-child { + padding-left: 16px; + + @include sm { + padding-left: 0; + } + } + } + + .name { + .link { + color: #0d61bf; + font-size: 16px; + font-weight: 500; + line-height: 24px; + text-decoration: none; + + @include sm { + text-decoration: underline; + margin-bottom: 8px; + display: block; + } + } + } + + .placement, + .points { + color: #2a2a2a; + font-size: 16px; + font-weight: 700; + line-height: 24px; + + span { + font-weight: 400; + padding-left: 8px; + } + } + } +} + +.buttons { + margin-top: 10px; + display: flex; + flex-direction: row; + justify-content: center; + + .close-btn { + color: #fafafb; + font-family: Roboto, sans-serif; + font-size: 14px; + font-weight: 700; + letter-spacing: 0.8px; + line-height: 40px; + background-color: #137d60; + border-radius: 20px; + border: none; + text-transform: uppercase; + padding: 0 20px; + + &:hover { + background-color: #0ab88a !important; + box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.2); + } + } +} + +.header-table-content { + display: flex; + align-items: center; +} + +.sort-container { + display: flex; + flex-direction: column; + margin-left: 5px; + padding: 0; + border: none; + outline: none; + background: transparent; +} + +.sort-container > div { + width: 0; + height: 0; + border-left: 4px solid transparent; + border-right: 4px solid transparent; +} + +.sort-up { + border-bottom: 4px solid $light-gray; + margin-bottom: 2px; + + &.active { + border-bottom: 4px solid $tc-black; + } +} + +.sort-down { + border-top: 4px solid $light-gray; + + &.active { + border-top: 4px solid $tc-black; + } +} diff --git a/src/shared/components/Leaderboard/LeaderboardTable/index.jsx b/src/shared/components/Leaderboard/LeaderboardTable/index.jsx index 59950a792a..1f7eb08bc5 100644 --- a/src/shared/components/Leaderboard/LeaderboardTable/index.jsx +++ b/src/shared/components/Leaderboard/LeaderboardTable/index.jsx @@ -27,7 +27,6 @@ import React from 'react'; import PT from 'prop-types'; import { Avatar } from 'topcoder-react-ui-kit'; import { config } from 'topcoder-react-utils'; -import _ from 'lodash'; import DefaultAvatar from 'assets/images/default-avatar-photo.svg'; import { getRatingColor } from 'utils/tc'; @@ -36,11 +35,13 @@ import avatarStyles from '../avatarStyles.scss'; import defaultStyles from './themes/styles.scss'; // eslint-disable-line import tco20Styles from './themes/tco20.scss'; // eslint-disable-line import tco22Styles from './themes/tco22.scss'; // eslint-disable-line +import tco23Styles from './themes/tco23.scss'; // eslint-disable-line const THEME = { Default: 'defaultStyles', TCO20: 'tco20Styles', TCO22: 'tco22Styles', + TCO23: 'tco23Styles', }; /** @@ -61,12 +62,14 @@ export default function LeaderboardTable(props) { themeName, } = props; const stylesName = THEME[themeName]; + /* eslint-disable no-confusing-arrow */ + /* eslint-disable no-nested-ternary */ + const addSufix = val => isAlgo ? (val !== 1 ? `${val} matches` : `${val} match`) : (val !== 1 ? `${val} challenges` : `${val} challenge`); const renderTableRows = comps => ( comps.map((competitor) => { let photoUrl = competitor['member_profile_basic.photo_url'] || competitor.avatar; if (photoUrl) { - photoUrl = `${config.CDN.PUBLIC}/avatar/${ - encodeURIComponent(photoUrl)}?size=40`; + photoUrl = `${config.CDN.PUBLIC}/avatar/${encodeURIComponent(photoUrl)}?size=40`; } const fulfillment = competitor['tco_leaderboard.fulfillment'] ? (parseFloat(competitor['tco_leaderboard.fulfillment']) * 100).toFixed(2).replace(/[.,]00$/, '') @@ -74,7 +77,7 @@ export default function LeaderboardTable(props) { const rating = competitor['member_profile_basic.max_rating']; return ( - + { @@ -120,7 +162,24 @@ export default function LeaderboardTable(props) { ) : null } - + { isTopGear ? ( @@ -142,7 +201,7 @@ export default function LeaderboardTable(props) { }) ); - return ( + return competitors.length ? (
Challenge Name -
+
Placement
-
+
Points
- +
+ {challenge.challenge_name || challenge['challenge.challenge_name'] || challenge['tco_leaderboard.challenge_id'] || challenge.challenge_id} {challenge['tco_leaderboard.placement'] || challenge.place}{challenge['tco_leaderboard.placement'] || challenge.place}placement - {challenge['tco_leaderboard.tco_points'] || challenge.points} + + {challenge['tco_leaderboard.tco_points'] || challenge.points}points
{competitor.rank}{competitor.rank} { @@ -91,28 +94,67 @@ export default function LeaderboardTable(props) { { - onUsernameClick ? ( + onUsernameClick && themeName !== 'TCO23' ? (
onUsernameClick(competitor)} style={{ color: rating !== undefined ? getRatingColor(rating) : null }} > + { + themeName === 'TCO23' && ( + + { + photoUrl ? ( + + ) : + } + + ) + } {competitor['member_profile_basic.handle'] || competitor.handle}
) : ( + { + themeName === 'TCO23' && ( + + { + photoUrl ? ( + + ) : + } + + ) + } {competitor['member_profile_basic.handle'] || competitor.handle} ) }
- {competitor.fulfillment && ({competitor.fulfillment} fulfillment)} + {fulfillment && ({fulfillment} fulfillment)} {competitor['tco_leaderboard.tco_points'] || competitor.points} points - {competitor['tco_leaderboard.challenge_count'] || competitor.challengecount} challenges + { + themeName === 'TCO23' ? ( +
onUsernameClick(competitor)} styleName={`${stylesName}.mobile-link`}> + {addSufix(competitor['tco_leaderboard.challenge_count'] || competitor.challengecount)} +
+ ) : {addSufix(competitor['tco_leaderboard.challenge_count'] || competitor.challengecount)} + }
{fulfillment}{competitor['tco_leaderboard.challenge_count'] || competitor.challengecount} + { + themeName === 'TCO23' ? ( + /* eslint-disable operator-linebreak */ + onUsernameClick ? + ( +
onUsernameClick(competitor)} + > + { `${addSufix(competitor['tco_leaderboard.challenge_count'] || competitor.challengecount)}` } +
+ ) : `${addSufix(competitor['tco_leaderboard.challenge_count'] || competitor.challengecount)}` + ) : ( + competitor['tco_leaderboard.challenge_count'] || competitor.challengecount + ) + } +
{formatPoints(competitor['tco_leaderboard.tco_points'] || competitor.points)}
@@ -182,6 +241,8 @@ export default function LeaderboardTable(props) { {renderTableRows(competitors)}
+ ) : ( +

No Data Available

); } diff --git a/src/shared/components/Leaderboard/LeaderboardTable/themes/tco23.scss b/src/shared/components/Leaderboard/LeaderboardTable/themes/tco23.scss new file mode 100644 index 0000000000..314c1aa819 --- /dev/null +++ b/src/shared/components/Leaderboard/LeaderboardTable/themes/tco23.scss @@ -0,0 +1,265 @@ +/* stylelint-disable no-descending-specificity */ +@import '~styles/mixins'; +$table-cell-padding: 2px; + +.LeaderboardTable { + /* Table basic styling (heavily 'inspired' by Bootstrap) */ + @include roboto-regular; + + background-color: transparent; + width: 100%; + margin: 30px auto 20px auto; + + th { + @include roboto-bold; + } + // Table cell sizing + td, + th { + &[class*="col-"] { + position: static; + float: none; + display: table-cell; + text-align: left; + } + } + // Cells + > thead, + > tbody, + > tfoot { + > tr { + > th, + > td { + padding: $table-cell-padding; + line-height: 59px; + vertical-align: top; + color: #47474f; + font-size: 20px; + font-weight: 400; + + @include xs-to-sm { + line-height: 25px; + border-top-right-radius: 8px; + border-bottom-right-radius: 8px; + } + } + } + } + // Bottom align for column headings + > thead > tr > th { + vertical-align: bottom; + line-height: 14px; + padding: 17px 0; + } + + // rows + > tbody > tr { + td:first-child { + border-top-left-radius: 8px; + border-bottom-left-radius: 8px; + } + + td:last-child { + border-top-right-radius: 8px; + border-bottom-right-radius: 8px; + } + + &:nth-child(odd) { + background-color: #f4f4f4; + } + + @include sm { + &:nth-child(even) { + background-color: #f4f4f4; + } + + td { + border-bottom: 16px solid white; + } + } + } + // hide the table head on extra-small devices + > thead { + @include sm { + display: none; + } + } + + // cell alignment + > tbody tr td, + > thead tr th { + vertical-align: middle; + } + + // Remove top border from thead by default + > thead:first-child { + > tr:first-child { + > th, + > td { + border-top: 0; + } + } + } + + /* Column specific styling */ + .col-rank { + width: 84px; + text-transform: uppercase; + color: white; + font-weight: 600; + font-family: Barlow, sans-serif; + font-size: 11px; + + @include sm { + width: 40px; + vertical-align: baseline; + padding-top: 20px; + border-radius: 0; + } + + span { + width: 24px; + height: 24px; + border-radius: 24px; + background-color: #16679a; + color: white; + display: flex; + align-items: center; + justify-content: center; + margin: auto; + margin-left: 16px; + + @include sm { + margin-right: 25px; + } + } + } + + .col-avatar { + width: 40px; + + @include md-to-xl { + line-height: 0; + } + + @include xs-to-sm { + display: none !important; + } + } + + .col-avatar .leaderboard-avatar, + .col-handle .leaderboard-avatar { + display: inline-block; + height: 32px; + width: 32px; + overflow: hidden; + + svg { + border-radius: 50%; + max-width: 100%; + } + + img { + border: none; + } + } + + .col-handle { + @include sm { + padding: 15px 0 20px 0; + } + + .handle-link, + a { + color: #0d61bf; + font-weight: 700; + font-size: 16px; + text-decoration: none; + cursor: pointer; + + @include sm { + display: flex; + align-items: center; + margin-bottom: 8px; + + .leaderboard-avatar { + margin-right: 8px; + } + } + } + } + + .col-handle .leaderboard-avatar { + @include md-to-xl { + display: none; + } + } + + .col-handle .winnings-info { + @include roboto-light; + + font-size: 14px; + // display only on small screens + display: none; + + @include sm { + display: block; + + span { + font-weight: 700; + } + } + + span { + display: block; + } + + .mobile-link { + color: #0d61bf; + font-weight: 500; + font-size: 14px; + line-height: 20px; + text-decoration: underline; + cursor: pointer; + } + } + + .col-fulfillment { + text-transform: uppercase; + } + + /* Table responsiveness */ + // Hide 'Fulfillment', 'Challenges' and 'Points' columns on small screens + .col-fulfillment, + .col-challenges, + .col-points { + width: auto !important; + color: #2a2a2a; + font-family: Roboto, sans-serif; + font-size: 16px; + font-weight: 700; + + @include sm { + display: none !important; + } + } + + .col-challenges { + font-weight: 500; + } +} + +.table-header { + .col-handleHeader, + .col-rank, + .col-fulfillment, + .col-challenges, + .col-points { + color: #767676; + font-family: Barlow, sans-serif; + font-size: 11px; + font-weight: 600; + text-transform: uppercase; + text-align: left; + } +} diff --git a/src/shared/components/Leaderboard/Podium/index.jsx b/src/shared/components/Leaderboard/Podium/index.jsx index 4aa167a52e..c3d176c973 100644 --- a/src/shared/components/Leaderboard/Podium/index.jsx +++ b/src/shared/components/Leaderboard/Podium/index.jsx @@ -27,11 +27,19 @@ import React from 'react'; import PT from 'prop-types'; +import { useMediaQuery } from 'react-responsive'; import PodiumSpot from '../PodiumSpot'; -import './styles.scss'; +import defaultStyles from './themes/default.scss'; // eslint-disable-line +import tco23Styles from './themes/tco23.scss'; // eslint-disable-line + +const THEME = { + Default: 'defaultStyles', + TCO23: 'tco23Styles', +}; export default function Podium(props) { + const isMobile = useMediaQuery({ maxWidth: 768 }); const { competitors, isCopilot, @@ -41,9 +49,14 @@ export default function Podium(props) { themeName, } = props; + const stylesName = THEME[themeName] || THEME.Default; + const renderComps = competitors; + if (!isMobile && renderComps.length === 3) { + [renderComps[0], renderComps[1]] = [renderComps[1], renderComps[0]]; + } const renderPodium = (comps) => { const podiumSpots = comps.map(comp => ( -
+
+
{podiumSpots}
); }; return ( -
- {renderPodium(competitors)} +
+ {renderPodium(renderComps)}
); } diff --git a/src/shared/components/Leaderboard/Podium/styles.scss b/src/shared/components/Leaderboard/Podium/themes/default.scss similarity index 100% rename from src/shared/components/Leaderboard/Podium/styles.scss rename to src/shared/components/Leaderboard/Podium/themes/default.scss diff --git a/src/shared/components/Leaderboard/Podium/themes/tco23.scss b/src/shared/components/Leaderboard/Podium/themes/tco23.scss new file mode 100644 index 0000000000..cbde4c5ef1 --- /dev/null +++ b/src/shared/components/Leaderboard/Podium/themes/tco23.scss @@ -0,0 +1,60 @@ +/* stylelint-disable no-descending-specificity */ +@import '~styles/mixins'; + +.Podium { + @include roboto-regular; + + line-height: 1.42; + margin: 88px auto 40px auto; + text-align: center; + + @include sm { + margin: 32px auto 24px auto; + } + + &::before, + &::after { + content: " "; + display: table; + } + + &::after { + clear: both; + } +} + +.PodiumWrap { + display: flex; + justify-content: center !important; + + @include xs-to-sm { + flex-direction: column; + align-items: center; + } + + .podium-column:nth-child(2) { + @include md-to-xl { + margin-top: -16px; + } + } + + .podium-column:nth-child(3) { + @include md-to-xl { + margin-top: 16px; + } + } +} + +.Podium .podium-column { + display: inline-block; + margin-right: 52px; + + &:last-child { + margin-right: 0; + } + + @include xs-to-sm { + margin-bottom: 15px; + margin-right: 0; + } +} diff --git a/src/shared/components/Leaderboard/PodiumSpot/index.jsx b/src/shared/components/Leaderboard/PodiumSpot/index.jsx index 7084d23b41..ad49696a8a 100644 --- a/src/shared/components/Leaderboard/PodiumSpot/index.jsx +++ b/src/shared/components/Leaderboard/PodiumSpot/index.jsx @@ -36,6 +36,7 @@ import avatarStyles from '../avatarStyles.scss'; import defaultStyles from './themes/styles.scss'; // eslint-disable-line import tco20Styles from './themes/tco20.scss'; // eslint-disable-line import tco22Styles from './themes/tco22.scss'; // eslint-disable-line +import tco23Styles from './themes/tco23.scss'; // eslint-disable-line /** * Object used to add a CSS modifier (PodiumSpot--first) that will @@ -72,6 +73,12 @@ const CUSTOM_STYLES = { 3: avatarStyles['tco22-3'], 4: avatarStyles['tco22-4'], }, + TCO23: { + 1: avatarStyles['tco23-1'], + 2: avatarStyles['tco23-2'], + 3: avatarStyles['tco23-3'], + 4: avatarStyles['tco23-4'], + }, }; /** @@ -88,6 +95,14 @@ const THEME = { Default: 'defaultStyles', TCO20: 'tco20Styles', TCO22: 'tco22Styles', + TCO23: 'tco23Styles', +}; + +const DISPLAY_RANKING_NUM = { + 1: '1ST', + 2: '2ND', + 3: '3RD', + 4: '4TH', }; /** @@ -111,8 +126,7 @@ export default function PodiumSpot(props) { const stylesName = THEME[themeName]; let photoUrl = competitor['member_profile_basic.photo_url'] || competitor.avatar; if (photoUrl) { - photoUrl = `${config.CDN.PUBLIC}/avatar/${ - encodeURIComponent(photoUrl)}?size=160`; + photoUrl = `${config.CDN.PUBLIC}/avatar/${encodeURIComponent(photoUrl)}?size=160`; } let rootStyle = `${stylesName}.PodiumSpot`; if (PODIUM_ITEM_MODIFIER[competitor.rank]) rootStyle += ` ${stylesName}.PodiumSpot--${PODIUM_ITEM_MODIFIER[competitor.rank]}`; @@ -120,7 +134,92 @@ export default function PodiumSpot(props) { ? (parseFloat(competitor['tco_leaderboard.fulfillment']) * 100).toFixed(2).replace(/[.,]00$/, '') : competitor.fulfillment; const rating = competitor['member_profile_basic.max_rating']; - return ( + return themeName === 'TCO23' ? ( +
+ { + competitor.rank <= 4 &&

{`${DISPLAY_RANKING_NUM[competitor.rank]} PLACE`}

+ } + { + onUsernameClick ? ( +
onUsernameClick(competitor)} + style={{ color: rating !== undefined ? getRatingColor(rating) : null }} + > + {competitor['member_profile_basic.handle'] || competitor.handle} +
+ ) : ( + + {competitor['member_profile_basic.handle'] || competitor.handle} + + ) + } +
4 ? 4 : competitor.rank]}`}> + + + + + { + photoUrl ? ( + + ) : + } +
{DISPLAY_RANKING[competitor.rank]}
+
+
+ { + isCopilot ? ( +
+ {fulfillment} + fulfillment +
+ ) : null + } +
+ {competitor['tco_leaderboard.challenge_count'] || competitor.challengecount} + { + isAlgo ? ( + # of matches + ) : ( + challenges + ) + } +
+
+ {formatPoints(competitor['tco_leaderboard.tco_points'] || competitor.points)} + points +
+ { + isAlgo ? ( +
+ {competitor['tco_leaderboard.total_score'] || competitor['srm_tco19.score']} + total score +
+ ) : null + } +
+
+
+ ) : (
{ diff --git a/src/shared/components/Leaderboard/PodiumSpot/themes/tco23.scss b/src/shared/components/Leaderboard/PodiumSpot/themes/tco23.scss new file mode 100644 index 0000000000..663879a3f2 --- /dev/null +++ b/src/shared/components/Leaderboard/PodiumSpot/themes/tco23.scss @@ -0,0 +1,223 @@ +/* stylelint-disable no-descending-specificity */ +@import '~styles/mixins'; +$podium-border-color: #ededf2; + +.PodiumSpot { + border-radius: 8px; + display: flex; + flex-direction: column; + width: auto; + box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1); + min-width: 392px; + justify-content: center; + align-items: center; + padding-top: 36px; + overflow: hidden; + + @include sm { + min-width: 320px; + } + + .leaderboard-avatar { + display: inline-block; + position: relative; + margin: 0; + overflow: visible; + } + + .ranking { + display: none; + } + + .winnings-info span { + display: block; + } + + .winnings-info { + display: flex; + justify-content: center; + width: 100%; + margin-top: 24px; + + .stats { + color: white; + font-size: 14px; + font-weight: 400; + line-height: 22px; + display: flex; + flex-direction: column; + align-items: center; + margin-right: 40px; + + @include sm { + margin-right: 16px; + } + + &:last-child { + margin-right: 0; + } + + .value-title { + text-align: left; + white-space: nowrap; + } + + .value { + font-size: 24px !important; + font-weight: 700; + line-height: 23px !important; + text-align: left; + } + + span { + font-size: 16px !important; + line-height: 25px !important; + } + } + + .stats-count { + .value-title, + .value { + color: #7f7f7f; + font-family: Roboto, sans-serif; + font-weight: 500; + } + } + + @include xs-to-sm { + font-size: 12px; + } + + @include md-to-lg { + font-size: 14px; + } + } + + a.profile-link { + display: block; + overflow: hidden; + text-overflow: ellipsis; + } + + .handle-link, + a.profile-link { + color: #0d61bf; + font-family: Roboto, sans-serif; + font-size: 24px; + font-weight: 700; + line-height: 32px; + text-align: left; + text-decoration: none; + cursor: pointer; + margin-bottom: 16px; + } + + .place { + @include barlow-condensed-semi-bold; + + font-size: 44px; + font-weight: 500; + line-height: 44px; + text-transform: uppercase; + margin-bottom: 8px; + color: #2a2a2a; + } + + .wave-wrap--first, + .wave-wrap--second, + .wave-wrap--third, + .wave-wrap--fourth { + position: relative; + width: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + margin-top: 120px; + padding-bottom: 36px; + + .leaderboard-avatar { + margin-top: -120px; + border: 3px solid white; + border-radius: 50%; + height: 152px; + width: 152px; + background-color: #fff; + + img { + width: 100%; + height: 100%; + border-radius: 50%; + margin: 0; + } + + svg { + margin: 0; + border-radius: 50%; + background-color: #fff; + } + } + + svg { + margin-top: -1px; + } + } + + .wave-wrap--first { + background-color: #2a2a2a; + } + + .wave-wrap--second { + background-color: #219174; + } + + .wave-wrap--third { + background-color: #16679a; + } + + .wave-wrap--fourth { + .stats { + color: #2a2a2a; + } + } +} + +.PodiumSpot--first { + .ranking { + background-color: #ffd84d; + color: #2a2a2a; + } +} + +.PodiumSpot--second { + .ranking { + background-color: #7f7f7f; + color: #fff; + } +} + +.PodiumSpot--third { + .ranking { + background-color: #d98f64; + color: #fff; + } +} + +.PodiumSpot--fourth { + .ranking { + background-color: #1e94a3; + color: #fff; + } +} + +.PodiumSpot--first, +.PodiumSpot--second, +.PodiumSpot--third, +.PodiumSpot--fourth { + margin-top: 0; + + .leaderboard-avatar { + height: 152px; + width: 152px; + } +} diff --git a/src/shared/components/Leaderboard/avatarStyles.scss b/src/shared/components/Leaderboard/avatarStyles.scss index 175ba5c201..c84446b00d 100644 --- a/src/shared/components/Leaderboard/avatarStyles.scss +++ b/src/shared/components/Leaderboard/avatarStyles.scss @@ -59,3 +59,12 @@ height: 100%; width: 100%; } + +.tco23-1, +.tco23-2, +.tco23-3, +.tco23-4 { + border-radius: 50%; + height: 100%; + width: 100%; +} diff --git a/src/shared/components/ProfilePage/Header/index.jsx b/src/shared/components/ProfilePage/Header/index.jsx index 5862718418..8a932cfd7e 100644 --- a/src/shared/components/ProfilePage/Header/index.jsx +++ b/src/shared/components/ProfilePage/Header/index.jsx @@ -51,7 +51,7 @@ const ProfileHeader = ({ getLookerDone, lookerInfo, info }) => { }; const tooltipContent = ( -
verified member
+
This member is compliant with Topcoder policies
and is a trusted member of the Topcoder community.
); diff --git a/src/shared/containers/tco/Leaderboard/themes/styles.scss b/src/shared/containers/tco/Leaderboard/themes/styles.scss index 0612fc39d3..4e71a38abf 100644 --- a/src/shared/containers/tco/Leaderboard/themes/styles.scss +++ b/src/shared/containers/tco/Leaderboard/themes/styles.scss @@ -3,7 +3,10 @@ .Leaderboard { padding: 0; margin: 40px auto; - max-width: 940px; + + @include sm { + padding: 0 16px; + } } .Leaderboard .section-title {