@mjhls/mjh-framework 1.0.674 → 1.0.675

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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.674
2
+ # mjh-framework v. 1.0.675
3
3
 
4
4
  > Foundation Framework
5
5
 
@@ -22,7 +22,7 @@ require('./moment-66a6a284.js');
22
22
  var Router = require('next/router');
23
23
  var Router__default = _interopDefault(Router);
24
24
  var index_es = require('./index.es-ab3f2690.js');
25
- var main = require('./main-b6c96c8d.js');
25
+ require('./main-b6c96c8d.js');
26
26
  var stringify = require('./stringify-7c5aff47.js');
27
27
  var slicedToArray = require('./slicedToArray-8f385299.js');
28
28
  var Button = _interopDefault(require('react-bootstrap/Button'));
@@ -132,6 +132,11 @@ var EventsDeck = function EventsDeck(_ref) {
132
132
  firstLoad = _useState16[0],
133
133
  setFirstLoad = _useState16[1];
134
134
 
135
+ var _useState17 = React.useState(false),
136
+ _useState18 = slicedToArray._slicedToArray(_useState17, 2),
137
+ mobileView = _useState18[0],
138
+ setMobileView = _useState18[1];
139
+
135
140
  var getEvents = function getEvents(url) {
136
141
  fetch(url, {
137
142
  headers: {
@@ -256,6 +261,9 @@ var EventsDeck = function EventsDeck(_ref) {
256
261
  }, [filter]);
257
262
 
258
263
  React.useEffect(function () {
264
+ if (window && window.innerWidth <= 1991) {
265
+ setMobileView(true);
266
+ }
259
267
  // get access token
260
268
  var cventAccessToken = js_cookie.js_cookie.get('cvent_access_token');
261
269
  if (cventAccessToken && cventAccessToken !== 'undefined') {
@@ -452,7 +460,7 @@ var EventsDeck = function EventsDeck(_ref) {
452
460
  React__default.createElement(
453
461
  'style',
454
462
  { jsx: true },
455
- '.filterTitle{\n font-weight: 400;\n }\n '
463
+ '\n .filterTitle {\n font-weight: 400;\n }\n '
456
464
  )
457
465
  ) : null;
458
466
  };
@@ -772,7 +780,7 @@ var EventsDeck = function EventsDeck(_ref) {
772
780
  )
773
781
  )
774
782
  ),
775
- main.main_39 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && React__default.createElement(
783
+ mobileView && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && React__default.createElement(
776
784
  'div',
777
785
  { style: { margin: '0 auto' } },
778
786
  renderMobileAd(index, numberOfItemsBeforeAd)
@@ -34,7 +34,7 @@ var index_es = require('./index.es-ab3f2690.js');
34
34
  require('react-dom');
35
35
  var visibilitySensor = require('./visibility-sensor-0c45a583.js');
36
36
  require('./index-b5eb3ff8.js');
37
- var main = require('./main-b6c96c8d.js');
37
+ require('./main-b6c96c8d.js');
38
38
  require('./stringify-7c5aff47.js');
39
39
  require('./slicedToArray-8f385299.js');
40
40
  var asyncToGenerator = require('./asyncToGenerator-533d476a.js');
@@ -73,7 +73,8 @@ var MasterDeck = function (_React$Component) {
73
73
  currentPage: _this.props.currentPage || 1,
74
74
  dataRemapped: !_this.props.showBI || !_this.props.brandInsightAd,
75
75
  lastDataSize: _this.data ? _this.data.length : 0,
76
- itemsPerPage: _this.params ? _this.params.to - _this.params.from : 2
76
+ itemsPerPage: _this.params ? _this.params.to - _this.params.from : 2,
77
+ mobileView: false
77
78
  }, _this.loadMore = debounce.debounce_1(function () {
78
79
  _this.setState(function (state) {
79
80
  var page = state.page,
@@ -146,7 +147,6 @@ var MasterDeck = function (_React$Component) {
146
147
  });
147
148
  }
148
149
  }, _this.checkMoreDataAvailable = function () {
149
- debugger;
150
150
  var _this$state2 = _this.state,
151
151
  from = _this$state2.from,
152
152
  itemsPerPage = _this$state2.itemsPerPage,
@@ -349,7 +349,7 @@ var MasterDeck = function (_React$Component) {
349
349
  React__default.Fragment,
350
350
  { key: index },
351
351
  React__default.createElement(_this2.Deck, { data: row, variant: variant, index: index, client: _this.props.client, defaultImage: _this.defaultImage }),
352
- main.main_39 && _this.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && React__default.createElement(
352
+ _this.state.mobileView && _this.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && React__default.createElement(
353
353
  'div',
354
354
  { className: 'ad-container', style: { margin: '0 auto' } },
355
355
  _this.renderMobileAd(index, numberOfItemsBeforeAd, _this.rightItems)
@@ -449,6 +449,10 @@ var MasterDeck = function (_React$Component) {
449
449
  if (typeof window !== 'undefined' && (!this.props.lgInfeedAd || !this.props.brandInsightAd || window.innerWidth < 1400) && !this.state.dataRemapped) {
450
450
  !this.state.dataRemapped && this.setState({ dataRemapped: true });
451
451
  }
452
+
453
+ if (typeof window !== 'undefined' && window.innerWidth <= 1191) {
454
+ !this.state.mobileView && this.setState({ mobileView: true });
455
+ }
452
456
  }
453
457
  }, {
454
458
  key: 'componentDidMount',
@@ -16,7 +16,7 @@ import Card from 'react-bootstrap/Card';
16
16
  import './moment-12415288.js';
17
17
  import { useRouter } from 'next/router';
18
18
  import { I as InfiniteScroll } from './index.es-938a3a58.js';
19
- import { m as main_39 } from './main-0465b2a0.js';
19
+ import './main-0465b2a0.js';
20
20
  import { _ as _JSON$stringify } from './stringify-008c8802.js';
21
21
  import { _ as _slicedToArray, a as _getIterator } from './slicedToArray-7021e5df.js';
22
22
  import Button from 'react-bootstrap/Button';
@@ -126,6 +126,11 @@ var EventsDeck = function EventsDeck(_ref) {
126
126
  firstLoad = _useState16[0],
127
127
  setFirstLoad = _useState16[1];
128
128
 
129
+ var _useState17 = useState(false),
130
+ _useState18 = _slicedToArray(_useState17, 2),
131
+ mobileView = _useState18[0],
132
+ setMobileView = _useState18[1];
133
+
129
134
  var getEvents = function getEvents(url) {
130
135
  fetch(url, {
131
136
  headers: {
@@ -250,6 +255,9 @@ var EventsDeck = function EventsDeck(_ref) {
250
255
  }, [filter]);
251
256
 
252
257
  useEffect(function () {
258
+ if (window && window.innerWidth <= 1991) {
259
+ setMobileView(true);
260
+ }
253
261
  // get access token
254
262
  var cventAccessToken = js_cookie.get('cvent_access_token');
255
263
  if (cventAccessToken && cventAccessToken !== 'undefined') {
@@ -446,7 +454,7 @@ var EventsDeck = function EventsDeck(_ref) {
446
454
  React__default.createElement(
447
455
  'style',
448
456
  { jsx: true },
449
- '.filterTitle{\n font-weight: 400;\n }\n '
457
+ '\n .filterTitle {\n font-weight: 400;\n }\n '
450
458
  )
451
459
  ) : null;
452
460
  };
@@ -766,7 +774,7 @@ var EventsDeck = function EventsDeck(_ref) {
766
774
  )
767
775
  )
768
776
  ),
769
- main_39 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && React__default.createElement(
777
+ mobileView && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && React__default.createElement(
770
778
  'div',
771
779
  { style: { margin: '0 auto' } },
772
780
  renderMobileAd(index, numberOfItemsBeforeAd)
@@ -28,7 +28,7 @@ import { I as InfiniteScroll } from './index.es-938a3a58.js';
28
28
  import 'react-dom';
29
29
  import { V as VisibilitySensor } from './visibility-sensor-0baa4eea.js';
30
30
  import './index-51a80699.js';
31
- import { m as main_39 } from './main-0465b2a0.js';
31
+ import './main-0465b2a0.js';
32
32
  import './stringify-008c8802.js';
33
33
  import './slicedToArray-7021e5df.js';
34
34
  import { _ as _Promise } from './asyncToGenerator-7c654f36.js';
@@ -67,7 +67,8 @@ var MasterDeck = function (_React$Component) {
67
67
  currentPage: _this.props.currentPage || 1,
68
68
  dataRemapped: !_this.props.showBI || !_this.props.brandInsightAd,
69
69
  lastDataSize: _this.data ? _this.data.length : 0,
70
- itemsPerPage: _this.params ? _this.params.to - _this.params.from : 2
70
+ itemsPerPage: _this.params ? _this.params.to - _this.params.from : 2,
71
+ mobileView: false
71
72
  }, _this.loadMore = debounce_1(function () {
72
73
  _this.setState(function (state) {
73
74
  var page = state.page,
@@ -140,7 +141,6 @@ var MasterDeck = function (_React$Component) {
140
141
  });
141
142
  }
142
143
  }, _this.checkMoreDataAvailable = function () {
143
- debugger;
144
144
  var _this$state2 = _this.state,
145
145
  from = _this$state2.from,
146
146
  itemsPerPage = _this$state2.itemsPerPage,
@@ -343,7 +343,7 @@ var MasterDeck = function (_React$Component) {
343
343
  React__default.Fragment,
344
344
  { key: index },
345
345
  React__default.createElement(_this2.Deck, { data: row, variant: variant, index: index, client: _this.props.client, defaultImage: _this.defaultImage }),
346
- main_39 && _this.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && React__default.createElement(
346
+ _this.state.mobileView && _this.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && React__default.createElement(
347
347
  'div',
348
348
  { className: 'ad-container', style: { margin: '0 auto' } },
349
349
  _this.renderMobileAd(index, numberOfItemsBeforeAd, _this.rightItems)
@@ -443,6 +443,10 @@ var MasterDeck = function (_React$Component) {
443
443
  if (typeof window !== 'undefined' && (!this.props.lgInfeedAd || !this.props.brandInsightAd || window.innerWidth < 1400) && !this.state.dataRemapped) {
444
444
  !this.state.dataRemapped && this.setState({ dataRemapped: true });
445
445
  }
446
+
447
+ if (typeof window !== 'undefined' && window.innerWidth <= 1191) {
448
+ !this.state.mobileView && this.setState({ mobileView: true });
449
+ }
446
450
  }
447
451
  }, {
448
452
  key: 'componentDidMount',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.674",
3
+ "version": "1.0.675",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",