@mjhls/mjh-framework 1.0.859-beta.2 → 1.0.859-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/View.js CHANGED
@@ -467,40 +467,35 @@ function generateSchema(props) {
467
467
  thumbnail = _props$article.thumbnail,
468
468
  published = _props$article.published,
469
469
  _updatedAt = _props$article._updatedAt,
470
- seoTag = _props$article.seoTag,
470
+ _props$article$seoTag = _props$article.seoTag,
471
+ seoTag = _props$article$seoTag === undefined ? [] : _props$article$seoTag,
471
472
  _props$Website = props.Website,
472
473
  liveDomain = _props$Website.liveDomain,
473
474
  websiteTitle = _props$Website.title,
474
475
  logo = _props$Website.logo,
475
476
  client = props.client;
476
477
 
477
- var authors = authorDetails && authorDetails.length > 0 && authorDetails.find(function (author) {
478
- return author.displayName;
479
- }) && authorDetails.reduce(function (result, author) {
480
- if (author.displayName) return [].concat(_toConsumableArray(result), [{
481
- '@type': 'Person',
482
- name: author.displayName
483
- }]);else return result;
484
- }, []);
478
+ var isAuthorFound = authorDetails && authorDetails.length > 0 && authorDetails[0].displayName;
485
479
  var articleSection = content_placement && content_placement.map(function (cp) {
486
480
  return cp.name;
487
481
  });
488
482
 
489
- if (title && thumbnail && client && published && _updatedAt) {
490
- return _extends({
483
+ if (title && thumbnail && published && websiteTitle && liveDomain && logo && isAuthorFound) {
484
+ return {
491
485
  '@context': 'https://schema.org',
492
486
  '@type': 'NewsArticle',
487
+ mainEntityOfPage: 'https://' + liveDomain + '/view/' + url.current,
493
488
  headline: title,
489
+ description: summary,
490
+ articleBody: toPlainText(body),
491
+ inLanguage: 'en-US',
494
492
  image: urlFor({ source: thumbnail, client: client }),
495
- datePublished: published,
496
- dateModified: _updatedAt,
497
- inLanguage: 'en-US'
498
- }, liveDomain && url && url.current && {
499
- mainEntityOfPage: {
500
- '@type': 'WebPage',
501
- '@id': 'https://' + liveDomain + '/view/' + url.current
502
- }
503
- }, websiteTitle && liveDomain && logo && {
493
+ keywords: seoTag.join(),
494
+ articleSection: articleSection,
495
+ author: {
496
+ '@type': 'Person',
497
+ name: authorDetails[0].displayName
498
+ },
504
499
  publisher: {
505
500
  '@type': 'Organization',
506
501
  name: websiteTitle,
@@ -508,8 +503,10 @@ function generateSchema(props) {
508
503
  '@type': 'ImageObject',
509
504
  url: 'https://' + liveDomain + logo
510
505
  }
511
- }
512
- }, articleSection && { articleSection: articleSection }, seoTag && seoTag.length > 0 && { keywords: seoTag.join() }, body && body.length > 0 && { articleBody: toPlainText(body) }, summary && { description: summary }, authors && authors.length > 0 && { author: authors });
506
+ },
507
+ datePublished: published,
508
+ dateModified: _updatedAt
509
+ };
513
510
  }
514
511
  return null;
515
512
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.859-beta.2",
3
+ "version": "1.0.859-beta.4",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",
@@ -68,6 +68,7 @@
68
68
  "react-device-detect": "^1.11.14",
69
69
  "react-dfp": "^0.19.0",
70
70
  "react-dom": "^16.12.0",
71
+ "react-facebook": "^8.1.4",
71
72
  "react-icons": "^3.8.0",
72
73
  "react-infinite-scroll-component": "^5.0.4",
73
74
  "react-lazyload": "^2.6.5",