diff --git a/.circleci/config.yml b/.circleci/config.yml index cd59bd1a12..08fe8813f1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -357,7 +357,7 @@ workflows: filters: branches: only: - - talk-cloud + - free # This is beta env for production soft releases - "build-prod-beta": context : org-global diff --git a/src/shared/components/Contentful/Article/Article.jsx b/src/shared/components/Contentful/Article/Article.jsx index c9078713ea..93dbeaca03 100644 --- a/src/shared/components/Contentful/Article/Article.jsx +++ b/src/shared/components/Contentful/Article/Article.jsx @@ -1,3 +1,4 @@ +/* eslint-disable max-len */ /* eslint-disable react/no-unused-state */ /** * The core article rendering. @@ -13,6 +14,7 @@ import markdown from 'utils/markdown'; import ContentfulLoader from 'containers/ContentfulLoader'; import LoadingIndicator from 'components/LoadingIndicator'; import YouTubeVideo from 'components/YouTubeVideo'; +import Viewport from 'components/Contentful/Viewport'; import moment from 'moment'; import localStorage from 'localStorage'; import { Helmet } from 'react-helmet'; @@ -33,6 +35,11 @@ const htmlToText = require('html-to-text'); const CONTENT_PREVIEW_LENGTH = 110; // Votes local storage key const LOCAL_STORAGE_KEY = 'VENBcnRpY2xlVm90ZXM='; +// def banner image +const DEFAULT_BANNER_IMAGE = 'https://images.ctfassets.net/piwi0eufbb2g/7v2hlDsVep7FWufHw0lXpQ/2505e61a880e68fab4e80cd0e8ec1814/0C37CB5E-B253-4804-8935-78E64E67589E.png'; +// random ads banner - left sidebar +const RANDOM_BANNERS = ['6G8mjiTC1mzeSQ2YoUG1gB', '1DnDD02xX1liHfSTf5Vsn8', 'HQZ3mN0rR92CbNTkKTHJ5', '1OLoX8ZsvjAnn4TdGbZESD', '77jn01UGoQe2gqA7x0coQD']; +const RANDOM_BANNER = RANDOM_BANNERS[_.random(0, 4)]; export default class Article extends React.Component { componentDidMount() { @@ -131,33 +138,45 @@ export default class Article extends React.Component { - - + + - {/* Banner */} - { - fields.featuredImage ? ( -
- - - - - - - - +
+ {/* Banner */} +
+
+
+

{moment(fields.creationDate).format('MMMM D, YYYY')}

+

{fields.title}

+
+
+ { + fields.featuredImage ? ( +
+ + + + + +
+
+ ) : ( + Thrive - default banner + ) + } +
- ) : null - } -
-
- {/* Authors */} -
- { + Thrive banner shape +
+
+
+ {/* Authors */} +
+ { _.map(fields.contentAuthor, author => (
{ @@ -189,72 +208,89 @@ export default class Article extends React.Component {
)) } -
-
-

DURATION

- {fields.readTime} -
-

categories & Tags

- {/* Tags */} -
- { +
+
+

DURATION

+ {fields.readTime} +
+

categories

+ {/* Cats */} +
+ { + _.map(fields.contentCategory, cat => ( +
+ {cat.fields.name} +
+ )) + } +
+
+

Tags

+ {/* Tags */} +
+ { _.map(fields.tags, tag => (
{tag}
)) } +
+
+

share

+ +
+
+ +
-
-

share

- -
-
- {/* Content */} -
-
-

{moment(fields.creationDate).format('MMMM D, YYYY')}

-

{fields.title}

-
- - { + {/* Content */} +
+ + { fields.type === 'Video' && fields.contentUrl ? ( ) : null } - {/* Voting */} -
-
-
this.updateVote('up')} onKeyPress={() => this.updateVote('up')}> - -
- - { + {/* Voting */} +
+
+
this.updateVote('up')} onKeyPress={() => this.updateVote('up')}> + +
+ + { upvotes } - -
-
-
this.updateVote('down')} onKeyPress={() => this.updateVote('down')}> - + +
+
+
this.updateVote('down')} onKeyPress={() => this.updateVote('down')}> + +
+ {downvotes}
- {downvotes}
-
- {/* Recommended */} - { + {/* Recommended */} + { fields.recommended ? (
@@ -331,6 +367,7 @@ export default class Article extends React.Component {
) : null } +
); } diff --git a/src/shared/components/Contentful/Article/themes/default.scss b/src/shared/components/Contentful/Article/themes/default.scss index 9078820319..d5ad74af45 100644 --- a/src/shared/components/Contentful/Article/themes/default.scss +++ b/src/shared/components/Contentful/Article/themes/default.scss @@ -1,6 +1,11 @@ @import "~styles/mixins"; @import "~components/Contentful/default"; +.wrapper { + overflow-x: hidden; + flex-direction: column; +} + .shareButtons { margin-top: 10px; @@ -16,7 +21,7 @@ .contentContainer, .contentContainerWithBanner { max-width: $screen-lg; - margin: 70px auto 90px auto; + margin: 0 auto 90px auto; width: 100%; display: flex; @@ -25,6 +30,11 @@ margin: 30px auto; } + @media screen and (max-width: 1280px) and (min-width: 768px) { + padding-left: 15px; + padding-right: 15px; + } + .contentLeftBar { max-width: 164px; @@ -149,6 +159,19 @@ letter-spacing: 0.4px; line-height: 15px; text-align: left; + + .catLink { + font-weight: 500; + } + } + } + + .leftSidebarContent { + margin-top: 23px; + + @include xs-to-sm { + margin-top: 0; + margin-bottom: 40px; } } @@ -174,6 +197,10 @@ text-transform: uppercase; } + > *:first-child { + margin-top: 0; + } + @include gui-kit-headers; p { @@ -329,34 +356,6 @@ color: #8231a9; } } - - .articleContentTop { - display: flex; - flex-direction: column; - - .articleDate { - color: #2a2a2a; - font-family: Roboto, sans-serif; - font-size: 12px; - font-weight: 700; - letter-spacing: 1px; - line-height: 16px; - text-align: left; - margin: 0; - } - - .articleTitle { - color: #2a2a2a; - font-family: BarlowCondensed, sans-serif; - font-size: 60px; - font-weight: 500; - line-height: 58px; - text-align: left; - margin-bottom: 28px; - text-transform: uppercase; - margin-top: 8px; - } - } } .actionContainer { @@ -419,19 +418,145 @@ margin-top: 0; } -.bannerContainer { +.bannerContainer, +.bannerContainerDefaultImage { margin: auto; - max-width: 1024px; width: 100%; + background-color: #e9e9e9; + flex-direction: column; + overflow: visible; + + @include xs-to-sm { + margin-bottom: 200px; + } - @include xs-to-md { - padding: 0 15px; + @media screen and (min-width: 1024px) and (max-width: 1440px) { + margin-bottom: 50px; } - .site-header-background { - width: 100%; - height: calc(100vw * (9 / 16)); - max-height: 565px; + @media screen and (max-width: 425px) { + margin-bottom: 300px; + } + + .bannerInner { + display: flex; + max-width: 1280px; + margin: auto; + align-items: center; + padding: 75px 0 45px; + + @include xs-to-sm { + flex-direction: column; + padding: 45px 15px 90px; + } + + @media screen and (max-width: 1280px) and (min-width: 768px) { + padding-left: 15px; + padding-right: 15px; + } + + .bannerInnerLeft { + display: flex; + flex-direction: column; + flex: 2; + margin-right: 130px; + + @include xs-to-sm { + margin-right: 0; + } + + .articleDate { + color: #2a2a2a; + font-family: Roboto, sans-serif; + font-size: 12px; + font-weight: 700; + letter-spacing: 1px; + line-height: 16px; + text-align: left; + margin: 0; + } + + .articleTitle { + color: #2a2a2a; + font-family: BarlowCondensed, sans-serif; + font-size: 60px; + font-weight: 500; + line-height: 58px; + text-align: left; + margin-bottom: 28px; + text-transform: uppercase; + margin-top: 8px; + } + } + + .bannerInnerRight { + position: relative; + width: 445px; + z-index: 1; + + @include xs-to-sm { + width: 100%; + max-width: 445px; + } + + .site-header-background { + width: 100%; + height: 355px; + position: absolute; + top: -95px; + + @include xs-to-sm { + height: auto; + top: 0; + } + + .bannerSvg { + position: absolute; + width: 0; + height: 0; + + /* stylelint-disable */ + > clipPath { + transform: translate(445px, 0) scaleX(-1); + + @media screen and (max-width: 425px) and (min-width: 375px) { + transform: translate(380px, 0) scaleX(-1); + } + + @media screen and (max-width: 375px) and (min-width: 320px) { + transform: translate(330px, 0) scaleX(-1); + } + + @media screen and (max-width: 320px) { + transform: translate(275px, 0) scaleX(-1); + } + } + /* stylelint-enable */ + } + + .bannerClippedImageHolder { + width: 100%; + height: 355px; + background-size: cover; + background-position: center center; + -webkit-clip-path: url(#thrive-banner-clip-path); + clip-path: url(#thrive-banner-clip-path); + } + } + } + } + + .bannerBottShape { + width: calc(100% + 4px); + position: relative; + left: -2px; + bottom: -10px; + } +} + +.bannerContainerDefaultImage { + @media screen and (max-width: 425px) { + margin-bottom: 180px; } } @@ -476,11 +601,15 @@ align-items: center; } + @include xs-to-sm { + padding: 0 15px; + } + .recommendedCard { background-color: #555; border-radius: 10px; width: 413px; - height: 457px; + min-height: 477px; display: flex; flex-direction: column; @@ -496,6 +625,10 @@ } } + @media screen and (max-width: 413px) { + width: auto; + } + .recommendedImage { width: 413px; height: 200px; @@ -503,6 +636,10 @@ border-top-right-radius: 10px; background-size: cover; background-position: 0 center; + + @media screen and (max-width: 413px) { + width: auto; + } } .recommendedImageBottomShape { @@ -511,7 +648,7 @@ background-repeat: no-repeat; background-size: cover; margin-top: -40px; - background-position: 0 -184px; + background-position: bottom; transform: scaleY(-1); } @@ -525,6 +662,10 @@ text-transform: uppercase; margin-top: 36px 40px 7px 40px; padding: 36px 46px 7px 46px; + + @include xs-to-sm { + padding-top: 10px; + } } .recommendedCardContent {