@mentor-medier/article-body-block
Advanced tools
Comparing version 5.10.4 to 5.11.2
@@ -12,2 +12,3 @@ import React, { Fragment } from 'react'; | ||
VideoPlayer as VideoPlayerPresentational, | ||
LazyLoad, isServerSide, | ||
} from '@wpmedia/engine-theme-sdk'; | ||
@@ -144,6 +145,12 @@ import Blockquote from './_children/blockquote'; | ||
case 'correction': { | ||
// can either be clarification or correction | ||
const { correction_type: labelType } = item; | ||
const labelText = labelType === 'clarification' | ||
? phrases.t('article-body-block.clarification') | ||
: phrases.t('article-body-block.correction'); | ||
return (item.text && item.text.length > 0) ? ( | ||
<Fragment key={key}> | ||
<section className="correction"> | ||
<h2 className="h6-primary">{item.correction_type || 'Correction'}</h2> | ||
<h2 className="h6-primary">{labelText}</h2> | ||
<p>{item.text}</p> | ||
@@ -235,3 +242,3 @@ </section> | ||
const ArticleBodyChain = ({ children }) => { | ||
const ArticleBodyChainItems = ({ children }) => { | ||
const { | ||
@@ -290,2 +297,16 @@ globalContent: items = {}, customFields = {}, arcSite, id, | ||
const ArticleBodyChain = ({ customFields = {}, children }) => { | ||
const { isAdmin } = useFusionContext(); | ||
if (customFields.lazyLoad && isServerSide() && !isAdmin) { // On Server | ||
return null; | ||
} | ||
return ( | ||
<LazyLoad enabled={customFields.lazyLoad && !isAdmin}> | ||
<ArticleBodyChainItems customFields={{ ...customFields }}> | ||
{children} | ||
</ArticleBodyChainItems> | ||
</LazyLoad> | ||
); | ||
}; | ||
ArticleBodyChain.propTypes = { | ||
@@ -298,2 +319,7 @@ customFields: PropTypes.shape({ | ||
}), | ||
lazyLoad: PropTypes.bool.tag({ | ||
name: 'Lazy Load block?', | ||
defaultValue: false, | ||
description: 'Turning on lazy-loading will prevent this block from being loaded on the page until it is nearly in-view for the user.', | ||
}), | ||
}), | ||
@@ -300,0 +326,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
/* eslint-disable react/jsx-props-no-spreading,import/no-unresolved */ | ||
/* eslint-disable import/no-unresolved */ | ||
/* istanbul ignore file */ | ||
@@ -3,0 +3,0 @@ import React from 'react'; |
@@ -6,28 +6,36 @@ # Change Log | ||
## [5.11.2](https://github.com/mentor-medier/fusion-news-theme-blocks/compare/v5.11.1...v5.11.2) (2021-05-03) | ||
## [5.10.4](https://github.com/mentor-medier/fusion-news-theme-blocks/compare/v5.10.3...v5.10.4) (2021-03-24) | ||
**Note:** Version bump only for package @mentor-medier/article-body-block | ||
## [5.10.3](https://github.com/mentor-medier/fusion-news-theme-blocks/compare/v5.10.2...v5.10.3) (2021-03-12) | ||
## [5.10.3](https://github.com/mentor-medier/fusion-news-theme-blocks/compare/v5.10.1...v5.10.3) (2021-03-12) | ||
## [5.9.15](https://github.com/mentor-medier/fusion-news-theme-blocks/compare/v5.9.14...v5.9.15) (2021-01-14) | ||
# [5.10.0](https://github.com/mentor-medier/fusion-news-theme-blocks/compare/v5.9.15...v5.10.0) (2021-02-17) | ||
## [5.9.12](https://github.com/mentor-medier/fusion-news-theme-blocks/compare/v5.9.11-alpha.0...v5.9.12) (2021-01-10) | ||
**Note:** Version bump only for package @mentor-medier/article-body-block | ||
## [5.9.5](https://github.com/mentor-medier/fusion-news-theme-blocks/compare/v5.9.4...v5.9.5) (2020-12-22) | ||
## [5.10.2](https://github.com/mentor-medier/fusion-news-theme-blocks/compare/v5.10.1...v5.10.2) (2021-03-12) | ||
## [5.9.4](https://github.com/mentor-medier/fusion-news-theme-blocks/compare/v5.9.3...v5.9.4) (2020-12-22) | ||
# [5.10.0](https://github.com/mentor-medier/fusion-news-theme-blocks/compare/v5.9.15...v5.10.0) (2021-02-17) | ||
## [5.9.3](https://github.com/mentor-medier/fusion-news-theme-blocks/compare/v5.9.2...v5.9.3) (2020-12-22) | ||
## [5.9.2](https://github.com/mentor-medier/fusion-news-theme-blocks/compare/v5.9.1...v5.9.2) (2020-12-22) | ||
**Note:** Version bump only for package @mentor-medier/article-body-block | ||
@@ -39,5 +47,5 @@ | ||
# [5.10.0](https://github.com/mentor-medier/fusion-news-theme-blocks/compare/v5.9.15...v5.10.0) (2021-02-17) | ||
## [5.11.1](https://github.com/WPMedia/fusion-news-theme-blocks/compare/v5.11.1-hotfix.0...v5.11.1) (2021-04-26) | ||
**Note:** Version bump only for package @mentor-medier/article-body-block | ||
**Note:** Version bump only for package @wpmedia/article-body-block | ||
@@ -48,2 +56,26 @@ | ||
## [5.10.3](https://github.com/WPMedia/fusion-news-theme-blocks/compare/v5.10.3-hotfix.0...v5.10.3) (2021-04-13) | ||
**Note:** Version bump only for package @wpmedia/article-body-block | ||
## [5.10.2](https://github.com/WPMedia/fusion-news-theme-blocks/compare/v5.10.0...v5.10.2) (2021-03-30) | ||
**Note:** Version bump only for package @wpmedia/article-body-block | ||
## [5.10.1](https://github.com/WPMedia/fusion-news-theme-blocks/compare/v5.10.0...v5.10.1) (2021-03-30) | ||
**Note:** Version bump only for package @wpmedia/article-body-block | ||
## [5.9.2](https://github.com/WPMedia/fusion-news-theme-blocks/compare/v5.9.1...v5.9.2) (2021-01-14) | ||
@@ -50,0 +82,0 @@ |
{ | ||
"name": "@mentor-medier/article-body-block", | ||
"version": "5.10.4", | ||
"version": "5.11.2", | ||
"description": "Fusion News Theme article body block", | ||
@@ -13,3 +13,4 @@ "author": "Brent Miller <brent.miller@washport.com>", | ||
"files": [ | ||
"chains" | ||
"chains", | ||
"intl.json" | ||
], | ||
@@ -38,3 +39,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "c3cc9b9b6651f37f4e6dfd704a068acb9e5e6733" | ||
"gitHead": "acb7bb159e0bef164bd1ab1d26cb68707968368d" | ||
} |
Sorry, the diff of this file is not supported yet
46315
20
677