diff --git a/__tests__/shared/components/Contentful/Image/Image.jsx b/__tests__/shared/components/Contentful/Image/Image.jsx deleted file mode 100644 index 098c1f7572..0000000000 --- a/__tests__/shared/components/Contentful/Image/Image.jsx +++ /dev/null @@ -1,24 +0,0 @@ -import React from 'react'; -import Renderer from 'react-test-renderer/shallow'; -import { ImageInner } from 'components/Contentful/Image/Image'; - -test('Matches shallow shapshot', () => { - const renderer = new Renderer(); - const MOCK_PROPS = { - id: '1', - image: {}, - imageSource: { - file: { - url: 'https://www.topcoder.com', - }, - }, - clipSvg: { - file: { - url: 'https://www.topcoder.com', - }, - }, - theme: {}, - }; - renderer.render(); - expect(renderer.getRenderOutput()).toMatchSnapshot(); -}); diff --git a/__tests__/shared/components/Contentful/Image/__snapshots__/Image.jsx.snap b/__tests__/shared/components/Contentful/Image/__snapshots__/Image.jsx.snap deleted file mode 100644 index 8540327616..0000000000 --- a/__tests__/shared/components/Contentful/Image/__snapshots__/Image.jsx.snap +++ /dev/null @@ -1,34 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Matches shallow shapshot 1`] = ` -
- - } - src="https://www.topcoder.com" - supportTest={[Function]} - uniquifyIDs={true} - wrapper={[Function]} - /> - -
-`; diff --git a/__tests__/shared/components/__snapshots__/TopcoderFooter.jsx.snap b/__tests__/shared/components/__snapshots__/TopcoderFooter.jsx.snap index bc62da49cb..dafcdedca0 100644 --- a/__tests__/shared/components/__snapshots__/TopcoderFooter.jsx.snap +++ b/__tests__/shared/components/__snapshots__/TopcoderFooter.jsx.snap @@ -495,7 +495,7 @@ exports[`Matches shallow shapshot 1`] = ` className="src-shared-components-TopcoderFooter-___style__mobile-navi-col___3BcW4" > ABOUT diff --git a/src/server/routes/feeds.js b/src/server/routes/feeds.js index c6046f2743..9e1810e9cd 100644 --- a/src/server/routes/feeds.js +++ b/src/server/routes/feeds.js @@ -26,6 +26,7 @@ routes.get('/thrive', async (req, res, next) => { limit: 20, order: '-sys.createdAt', include: 2, + 'sys.firstPublishedAt[exists]': true, }); const feed = new RSS({ title: 'Topcoder Thrive', @@ -45,8 +46,8 @@ routes.get('/thrive', async (req, res, next) => { feed.item({ title: entry.fields.title, description: ReactDOMServer.renderToString(md(entry.fields.content)), - url: `https://topcoder.com/thrive/articles/${entry.fields.slug || encodeURIComponent(entry.fields.title)}?utm_source=community&utm_campaign=thrive-feed&utm_medium=promotion`, - date: entry.fields.creationDate, + url: `https://topcoder.com/thrive/articles/${entry.fields.slug || encodeURIComponent(entry.fields.title)}?utm_source=thrive&utm_campaign=thrive-feed&utm_medium=rss-feed`, + date: entry.sys.createdAt, categories: entry.fields.tags, author: entry.fields.contentAuthor[0].fields.name, }); diff --git a/src/shared/components/Contentful/Article/Article.jsx b/src/shared/components/Contentful/Article/Article.jsx index e87248eb3e..f00c373f90 100644 --- a/src/shared/components/Contentful/Article/Article.jsx +++ b/src/shared/components/Contentful/Article/Article.jsx @@ -170,6 +170,7 @@ class Article extends React.Component { +
{/* Banner */} diff --git a/src/shared/components/Contentful/Image/Image.jsx b/src/shared/components/Contentful/Image/Image.jsx index c45e077ffd..713c854e17 100644 --- a/src/shared/components/Contentful/Image/Image.jsx +++ b/src/shared/components/Contentful/Image/Image.jsx @@ -1,3 +1,4 @@ +/* eslint-disable max-len */ /** * The core image rendering. */ @@ -68,12 +69,10 @@ export class ImageInner extends React.Component { theme, id, image, - imageSource, + imageSources, clipSvg, animation, } = this.props; - - const imageUrl = _.get(imageSource, 'file.url'); const clipSvgUrl = _.get(clipSvg, 'file.url'); const imgStyle = image.extraStylesForImage ? fixStyle(image.extraStylesForImage) : {}; if (clipSvgUrl) { @@ -96,25 +95,47 @@ export class ImageInner extends React.Component { )} { animation.animateOnScroll ? ( - {image.alt + + + { + imageSources.sourceMobile ? ( + + ) : ( + + ) + } + {image.alt + ) : ( - {image.alt + + + { + imageSources.sourceMobile ? ( + + ) : ( + + ) + } + {image.alt + ) }
@@ -130,7 +151,7 @@ ImageInner.defaultProps = { ImageInner.propTypes = { id: PT.string.isRequired, image: PT.shape().isRequired, - imageSource: PT.shape().isRequired, + imageSources: PT.shape().isRequired, clipSvg: PT.shape(), theme: PT.shape({ 'img-wrap': PT.string, diff --git a/src/shared/components/Contentful/Image/index.jsx b/src/shared/components/Contentful/Image/index.jsx index e24a1eb694..f0b14a2768 100644 --- a/src/shared/components/Contentful/Image/index.jsx +++ b/src/shared/components/Contentful/Image/index.jsx @@ -7,7 +7,6 @@ import LoadingIndicator from 'components/LoadingIndicator'; import PT from 'prop-types'; import React from 'react'; import _ from 'lodash'; -import { useMediaQuery } from 'react-responsive'; import Image from './Image'; import defaultTheme from './themes/default.scss'; @@ -18,7 +17,7 @@ export default function ImageLoader(props) { const { id, preview, spaceName, environment, } = props; - const isTabletOrMobile = useMediaQuery({ maxWidth: 768 }); + // const isTabletOrMobile = useMediaQuery({ maxWidth: 768 }); return ( { const { fields } = data.entries.items[id]; - const imgId = _.get(fields, isTabletOrMobile && fields.sourceMobile ? 'sourceMobile.sys.id' : 'source.sys.id'); + const imgId = _.get(fields, 'source.sys.id'); + const imgIdMobile = _.get(fields, 'sourceMobile.sys.id'); const clipSvgId = _.get(fields, 'clipSvg.sys.id'); - const assetIds = _.compact([imgId, clipSvgId]); + const assetIds = _.compact( + [imgId, imgIdMobile, clipSvgId], + ); const animationId = _.get(fields, 'animationOnScroll.sys.id'); const entryIds = []; if (animationId) { @@ -45,8 +47,11 @@ export default function ImageLoader(props) { environment={environment} render={(assetData) => { const { items } = assetData.assets; - const imgFields = _.get(items, [imgId, 'fields']); const clipSvgFields = _.get(items, [clipSvgId, 'fields']); + const imageSources = { + source: _.get(items, [imgId, 'fields']), + sourceMobile: _.get(items, [imgIdMobile, 'fields']), + }; let animation = {}; if (animationId) { animation = { ...assetData.entries.items[animationId].fields }; @@ -54,7 +59,7 @@ export default function ImageLoader(props) { return ( {`Avatar
{member.rank}
+ {member.createdBy}
{member.createdBy} @@ -106,6 +107,7 @@ export default class MMLeaderboard extends Component {
{`Avatar
{data[2].rank}
+ {data[2].createdBy}
{data[2].createdBy} @@ -135,15 +137,17 @@ export default class MMLeaderboard extends Component { ))} { data.length > 10 && ( - - See Full Leaderbord - +
+ + See Full Leaderbord + +
)}
)} diff --git a/src/shared/components/MMatchLeaderboard/style.scss b/src/shared/components/MMatchLeaderboard/style.scss index 8b85fdacea..a9a26d8d28 100644 --- a/src/shared/components/MMatchLeaderboard/style.scss +++ b/src/shared/components/MMatchLeaderboard/style.scss @@ -121,12 +121,12 @@ $light-gray: #d4d4d4; .podiumTheme { display: block; - padding: 0 40px; + padding: 0 35px; @media screen and (max-width: 768px) { flex-direction: column; align-items: center; - padding: 0 20px; + padding: 0 45px; } .top3 { @@ -178,6 +178,18 @@ $light-gray: #d4d4d4; .topMemberPhotoAndPlace { position: relative; + display: flex; + + @media screen and (max-width: 768px) { + flex-direction: column; + align-items: center; + } + + > a { + @media screen and (min-width: 768px) { + display: none; + } + } .topMemberPhoto { width: 75px; @@ -192,7 +204,7 @@ $light-gray: #d4d4d4; position: absolute; width: 25px; height: 25px; - bottom: 15px; + bottom: 8px; right: 0; border-radius: 50%; display: flex; @@ -200,6 +212,10 @@ $light-gray: #d4d4d4; align-content: center; font-size: 16px; font-weight: 500; + + @media screen and (max-width: 768px) { + bottom: 32px; + } } .topMemberRank1 { @@ -225,12 +241,17 @@ $light-gray: #d4d4d4; a { font-size: 16px; + + @media screen and (max-width: 768px) { + display: none; + } } .topMemberScore { font-weight: 500; font-size: 16px; text-align: center; + margin-bottom: 18px; @media screen and (max-width: 768px) { margin-bottom: 0; @@ -245,6 +266,7 @@ $light-gray: #d4d4d4; justify-content: center; @media screen and (max-width: 768px) { + margin-top: 20px; margin-bottom: 0; flex-direction: column; } @@ -265,18 +287,22 @@ $light-gray: #d4d4d4; } a { - margin-right: 50px; + margin-right: 20px; flex: 1; + font-weight: 500; + white-space: nowrap; } - .followerScore { + .followerScore, + span { font-weight: 500; + color: #2a2a2a; } } } .followersRight { - margin-left: 65px; + margin-left: 60px; @media screen and (max-width: 768px) { margin-left: 0; @@ -285,6 +311,13 @@ $light-gray: #d4d4d4; > div:nth-child(3) { margin-bottom: 12px; + margin-left: -9px; + } + + .moreBtn { + @media screen and (max-width: 768px) { + text-align: center; + } } } } diff --git a/src/shared/components/TopcoderFooter/index.jsx b/src/shared/components/TopcoderFooter/index.jsx index 1fe6d66251..3d073f7b58 100644 --- a/src/shared/components/TopcoderFooter/index.jsx +++ b/src/shared/components/TopcoderFooter/index.jsx @@ -125,7 +125,7 @@ export default function TopcoderFooter() { HELP CENTER
- ABOUT + ABOUT
diff --git a/src/shared/components/buttons/themed/tc.scss b/src/shared/components/buttons/themed/tc.scss index 55df1ef13f..2edf7eacc7 100644 --- a/src/shared/components/buttons/themed/tc.scss +++ b/src/shared/components/buttons/themed/tc.scss @@ -8,6 +8,7 @@ text-transform: uppercase !important; margin: 0 !important; white-space: nowrap !important; + letter-spacing: 0.8px; } @mixin primary-green { @@ -110,6 +111,7 @@ text-transform: uppercase !important; margin: 0 !important; white-space: nowrap !important; + letter-spacing: 0.8px; } @mixin secondary-gray { @@ -137,6 +139,7 @@ text-transform: uppercase !important; margin: 0 !important; white-space: nowrap !important; + letter-spacing: 0.8px; } @mixin warn-red {