@mjhls/mjh-framework 1.0.939-iamge-width-v2 → 1.0.939-image-width-v1

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.
@@ -299,16 +299,16 @@ var DeckContent = function (_React$Component) {
299
299
  } else {
300
300
  articles = _this.state.data;
301
301
  }
302
- var getImageHeight = function getImageHeight(lgVar, aspectRatio, actualWidth, actualHeight, mobileView) {
302
+ var getImageHeight = function getImageHeight(lgVar, aspectRatio, mobileView) {
303
303
  if (mobileView) {
304
- return actualWidth > actualHeight ? Number(_this.props.imageWidth) / (2 * aspectRatio) + 'px' : Number(_this.props.imageWidth) * (2 * aspectRatio) + 'px';
304
+ return Number(_this.props.imageWidth) / (2 * aspectRatio) + 'px';
305
305
  } else {
306
306
  if (lgVar === 12) {
307
- return actualWidth > actualHeight ? Number(_this.props.imageWidth) / aspectRatio + 'px' : Number(_this.props.imageWidth) * aspectRatio + 'px';
307
+ return Number(_this.props.imageWidth) / aspectRatio + 'px';
308
308
  } else if (lgVar === 6) {
309
- return actualWidth > actualHeight ? Number(_this.props.imageWidth) / (2 * aspectRatio) + 'px' : Number(_this.props.imageWidth) * (2 * aspectRatio) + 'px';
309
+ return Number(_this.props.imageWidth) / (2 * aspectRatio) + 'px';
310
310
  } else {
311
- return actualWidth > actualHeight ? Number(_this.props.imageWidth) / (12 / lgVar * aspectRatio) + 'px' : Number(_this.props.imageWidth) * (12 / lgVar * aspectRatio) + 'px';
311
+ return Number(_this.props.imageWidth) / (12 / lgVar * aspectRatio) + 'px';
312
312
  }
313
313
  }
314
314
  };
@@ -347,9 +347,7 @@ var DeckContent = function (_React$Component) {
347
347
  'a',
348
348
  {
349
349
  href: _this.mapping[contentCategoryName] + '/' + row.url.current,
350
- style: {
351
- minHeight: getImageHeight(lgVar, row.thumbnail.asset.metadata.dimensions.aspectRatio, row.thumbnail.asset.metadata.dimensions.width, row.thumbnail.asset.metadata.dimensions.height, main.main_43)
352
- } },
350
+ style: { minHeight: getImageHeight(lgVar, row.thumbnail.asset.metadata.dimensions.aspectRatio, main.main_43) } },
353
351
  React__default['default'].createElement(
354
352
  index$1.LazyLoad,
355
353
  { height: _this.props.imageHeight },
@@ -289,16 +289,16 @@ var DeckContent = function (_React$Component) {
289
289
  } else {
290
290
  articles = _this.state.data;
291
291
  }
292
- var getImageHeight = function getImageHeight(lgVar, aspectRatio, actualWidth, actualHeight, mobileView) {
292
+ var getImageHeight = function getImageHeight(lgVar, aspectRatio, mobileView) {
293
293
  if (mobileView) {
294
- return actualWidth > actualHeight ? Number(_this.props.imageWidth) / (2 * aspectRatio) + 'px' : Number(_this.props.imageWidth) * (2 * aspectRatio) + 'px';
294
+ return Number(_this.props.imageWidth) / (2 * aspectRatio) + 'px';
295
295
  } else {
296
296
  if (lgVar === 12) {
297
- return actualWidth > actualHeight ? Number(_this.props.imageWidth) / aspectRatio + 'px' : Number(_this.props.imageWidth) * aspectRatio + 'px';
297
+ return Number(_this.props.imageWidth) / aspectRatio + 'px';
298
298
  } else if (lgVar === 6) {
299
- return actualWidth > actualHeight ? Number(_this.props.imageWidth) / (2 * aspectRatio) + 'px' : Number(_this.props.imageWidth) * (2 * aspectRatio) + 'px';
299
+ return Number(_this.props.imageWidth) / (2 * aspectRatio) + 'px';
300
300
  } else {
301
- return actualWidth > actualHeight ? Number(_this.props.imageWidth) / (12 / lgVar * aspectRatio) + 'px' : Number(_this.props.imageWidth) * (12 / lgVar * aspectRatio) + 'px';
301
+ return Number(_this.props.imageWidth) / (12 / lgVar * aspectRatio) + 'px';
302
302
  }
303
303
  }
304
304
  };
@@ -337,9 +337,7 @@ var DeckContent = function (_React$Component) {
337
337
  'a',
338
338
  {
339
339
  href: _this.mapping[contentCategoryName] + '/' + row.url.current,
340
- style: {
341
- minHeight: getImageHeight(lgVar, row.thumbnail.asset.metadata.dimensions.aspectRatio, row.thumbnail.asset.metadata.dimensions.width, row.thumbnail.asset.metadata.dimensions.height, main_43)
342
- } },
340
+ style: { minHeight: getImageHeight(lgVar, row.thumbnail.asset.metadata.dimensions.aspectRatio, main_43) } },
343
341
  React__default.createElement(
344
342
  LazyLoad,
345
343
  { height: _this.props.imageHeight },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.939-iamge-width-v2",
3
+ "version": "1.0.939-image-width-v1",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",