@mjhls/mjh-framework 1.0.803-beta.0 → 1.0.803-beta.1

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.
@@ -64,6 +64,16 @@ var ADFloatingFooter = function ADFloatingFooter(_ref) {
64
64
  previewAd = _useState4[0],
65
65
  setPreviewAd = _useState4[1];
66
66
 
67
+ var _useState5 = React.useState(false),
68
+ _useState6 = slicedToArray._slicedToArray(_useState5, 2),
69
+ showAd = _useState6[0],
70
+ setShowAd = _useState6[1];
71
+
72
+ React.useEffect(function () {
73
+ // Checking data in session storage to show AD
74
+ if (!sessionStorage.getItem('mjh-floating-footer-ad')) setShowAd(true);
75
+ }, []);
76
+
67
77
  React.useEffect(function () {
68
78
  var path = window && window.location && window.location.search;
69
79
  // Setting flag for Ad-preview URLs
@@ -93,12 +103,14 @@ var ADFloatingFooter = function ADFloatingFooter(_ref) {
93
103
  parent.style.width = '0%';
94
104
  parent.classList.remove('display-floating');
95
105
  parent.classList.add('hide-floating');
106
+ // Saving data in session storage on close AD
107
+ sessionStorage.setItem('mjh-floating-footer-ad', Math.floor(Date.now() / 1000));
96
108
  };
97
109
 
98
110
  return React__default.createElement(
99
111
  React__default.Fragment,
100
112
  null,
101
- widthFlag && adTargeting.document_url && React__default.createElement(
113
+ showAd && widthFlag && adTargeting.document_url && React__default.createElement(
102
114
  'div',
103
115
  { id: 'floating-ad-wrapper', className: 'floating-ad-wrapper display-floating ' + title },
104
116
  React__default.createElement(AdSlot, {
@@ -59,6 +59,16 @@ var ADFloatingFooter = function ADFloatingFooter(_ref) {
59
59
  previewAd = _useState4[0],
60
60
  setPreviewAd = _useState4[1];
61
61
 
62
+ var _useState5 = useState(false),
63
+ _useState6 = _slicedToArray(_useState5, 2),
64
+ showAd = _useState6[0],
65
+ setShowAd = _useState6[1];
66
+
67
+ useEffect(function () {
68
+ // Checking data in session storage to show AD
69
+ if (!sessionStorage.getItem('mjh-floating-footer-ad')) setShowAd(true);
70
+ }, []);
71
+
62
72
  useEffect(function () {
63
73
  var path = window && window.location && window.location.search;
64
74
  // Setting flag for Ad-preview URLs
@@ -88,12 +98,14 @@ var ADFloatingFooter = function ADFloatingFooter(_ref) {
88
98
  parent.style.width = '0%';
89
99
  parent.classList.remove('display-floating');
90
100
  parent.classList.add('hide-floating');
101
+ // Saving data in session storage on close AD
102
+ sessionStorage.setItem('mjh-floating-footer-ad', Math.floor(Date.now() / 1000));
91
103
  };
92
104
 
93
105
  return React__default.createElement(
94
106
  React__default.Fragment,
95
107
  null,
96
- widthFlag && adTargeting.document_url && React__default.createElement(
108
+ showAd && widthFlag && adTargeting.document_url && React__default.createElement(
97
109
  'div',
98
110
  { id: 'floating-ad-wrapper', className: 'floating-ad-wrapper display-floating ' + title },
99
111
  React__default.createElement(DFPAdSlot, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.803-beta.0",
3
+ "version": "1.0.803-beta.1",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",