@mjhls/mjh-framework 1.0.149 → 1.0.150

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/index.js CHANGED
@@ -6379,68 +6379,140 @@ var GridContent = function (_React$Component) {
6379
6379
  { className: 'grid-container' },
6380
6380
  this.state.data && this.state.data.map(function (row, index$$1) {
6381
6381
  var pageNumber = row.pageNumber || _this2.state.page;
6382
- var linkHref = '' + row.url.current;
6383
- if (row.blank || _this2.checkExternalUrl(row.url.current)) {
6384
- return React__default.createElement(
6385
- React__default.Fragment,
6386
- { key: itemCounter },
6387
- React__default.createElement(
6388
- VisibilitySensor,
6389
- {
6390
- onChange: function onChange(isVisible) {
6391
- isVisible && _this2.changePageNumber(pageNumber);
6392
- } },
6382
+ var contentCategoryName = row.contentCategory && row.contentCategory.name && _this2.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
6383
+ var linkHref = _this2.mapping[contentCategoryName] + '/' + row.url.current;
6384
+ if (row._type === 'feature') {
6385
+ if (row.blank || _this2.checkExternalUrl(row.url.current)) {
6386
+ return React__default.createElement(
6387
+ React__default.Fragment,
6388
+ { key: itemCounter },
6393
6389
  React__default.createElement(
6394
- 'div',
6395
- { counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
6390
+ VisibilitySensor,
6391
+ {
6392
+ onChange: function onChange(isVisible) {
6393
+ isVisible && _this2.changePageNumber(pageNumber);
6394
+ } },
6396
6395
  React__default.createElement(
6397
- Card,
6398
- { className: 'content-card', style: { flexDirection: index$$1 === 0 || index$$1 % 4 === 0 ? 'top' : 'row' } },
6399
- (row.thumbnail && row.thumbnail.asset || _this2.props.defaultImage) && React__default.createElement(
6400
- 'a',
6401
- { href: row.url.current, target: '_blank', className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-image' },
6402
- React__default.createElement(
6403
- LazyLoad,
6404
- { height: _this2.props.imageHeight },
6405
- React__default.createElement(Card.Img, {
6406
- variant: 'top',
6407
- src: _this2.renderCardImage(row, page),
6408
- alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
6409
- })
6410
- )
6411
- ),
6396
+ 'div',
6397
+ { counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
6412
6398
  React__default.createElement(
6413
- Card.Body,
6414
- null,
6415
- React__default.createElement(
6399
+ Card,
6400
+ { className: 'content-card', style: { flexDirection: index$$1 === 0 || index$$1 % 4 === 0 ? 'top' : 'row' } },
6401
+ (row.thumbnail && row.thumbnail.asset || _this2.props.defaultImage) && React__default.createElement(
6416
6402
  'a',
6417
- { href: row.url.current, target: '_blank' },
6403
+ { href: row.url.current, target: '_blank', className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-image' },
6418
6404
  React__default.createElement(
6419
- Card.Title,
6420
- null,
6421
- row.title
6405
+ LazyLoad,
6406
+ { height: _this2.props.imageHeight },
6407
+ React__default.createElement(Card.Img, {
6408
+ variant: 'top',
6409
+ src: _this2.renderCardImage(row, page),
6410
+ alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
6411
+ })
6422
6412
  )
6423
6413
  ),
6424
- _this2.props.showPublished && row.published && React__default.createElement(
6425
- Card.Subtitle,
6426
- { style: { marginTop: 0 } },
6427
- moment(row.published).format('MMMM DD, YYYY')
6414
+ React__default.createElement(
6415
+ Card.Body,
6416
+ null,
6417
+ React__default.createElement(
6418
+ 'a',
6419
+ { href: row.url.current, target: '_blank' },
6420
+ React__default.createElement(
6421
+ Card.Title,
6422
+ null,
6423
+ row.title
6424
+ )
6425
+ ),
6426
+ _this2.props.showPublished && row.published && React__default.createElement(
6427
+ Card.Subtitle,
6428
+ { style: { marginTop: 0 } },
6429
+ moment(row.published).format('MMMM DD, YYYY')
6430
+ ),
6431
+ _this2.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index$$1) {
6432
+ return _this2.renderAuthor(authorDetail, index$$1, row.authorMapping.length);
6433
+ }),
6434
+ React__default.createElement(
6435
+ Card.Text,
6436
+ { className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
6437
+ row.summary
6438
+ )
6439
+ )
6440
+ )
6441
+ )
6442
+ ),
6443
+ showVideo && (_this2.state.data.length < numberOfItemsBeforeVideo || index$$1 + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
6444
+ main_36 && _this2.props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && _this2.renderMobileAd(index$$1, numberOfItemsBeforeAd)
6445
+ );
6446
+ } else {
6447
+ return React__default.createElement(
6448
+ React__default.Fragment,
6449
+ { key: itemCounter },
6450
+ React__default.createElement(
6451
+ VisibilitySensor,
6452
+ {
6453
+ onChange: function onChange(isVisible) {
6454
+ isVisible && _this2.changePageNumber(pageNumber);
6455
+ } },
6456
+ React__default.createElement(
6457
+ 'div',
6458
+ { counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
6459
+ React__default.createElement(
6460
+ Card,
6461
+ { className: 'content-card', style: { flexDirection: index$$1 === 0 || index$$1 % 4 === 0 ? 'top' : 'row' } },
6462
+ (row.thumbnail && row.thumbnail.asset || _this2.props.defaultImage) && React__default.createElement(
6463
+ Link,
6464
+ { href: row.url.current },
6465
+ React__default.createElement(
6466
+ 'a',
6467
+ { className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-image' },
6468
+ React__default.createElement(
6469
+ LazyLoad,
6470
+ { height: _this2.props.imageHeight },
6471
+ React__default.createElement(Card.Img, {
6472
+ variant: 'top',
6473
+ src: _this2.renderCardImage(row, page),
6474
+ alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
6475
+ })
6476
+ )
6477
+ )
6428
6478
  ),
6429
- _this2.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index$$1) {
6430
- return _this2.renderAuthor(authorDetail, index$$1, row.authorMapping.length);
6431
- }),
6432
6479
  React__default.createElement(
6433
- Card.Text,
6434
- { className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
6435
- row.summary
6480
+ Card.Body,
6481
+ null,
6482
+ React__default.createElement(
6483
+ Link,
6484
+ { href: row.url.current },
6485
+ React__default.createElement(
6486
+ 'a',
6487
+ null,
6488
+ React__default.createElement(
6489
+ Card.Title,
6490
+ null,
6491
+ row.title
6492
+ )
6493
+ )
6494
+ ),
6495
+ _this2.props.showPublished && row.published && React__default.createElement(
6496
+ Card.Subtitle,
6497
+ { style: { marginTop: 0 } },
6498
+ moment(row.published).format('MMMM DD, YYYY')
6499
+ ),
6500
+ _this2.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index$$1) {
6501
+ return _this2.renderAuthor(authorDetail, index$$1, row.authorMapping.length);
6502
+ }),
6503
+ React__default.createElement(
6504
+ Card.Text,
6505
+ { className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
6506
+ row.summary
6507
+ )
6436
6508
  )
6437
6509
  )
6438
6510
  )
6439
- )
6440
- ),
6441
- showVideo && (_this2.state.data.length < numberOfItemsBeforeVideo || index$$1 + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
6442
- main_36 && _this2.props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && _this2.renderMobileAd(index$$1, numberOfItemsBeforeAd)
6443
- );
6511
+ ),
6512
+ showVideo && (_this2.state.data.length < numberOfItemsBeforeVideo || index$$1 + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
6513
+ main_36 && _this2.props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && _this2.renderMobileAd(index$$1, numberOfItemsBeforeAd)
6514
+ );
6515
+ }
6444
6516
  }
6445
6517
  return React__default.createElement(
6446
6518
  React__default.Fragment,