@twreporter/universal-header 2.2.0-rc.5 → 2.2.0-rc.6
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/CHANGELOG.md +11 -0
- package/lib/containers/header.js +7 -21
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.2.0-rc.6](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/universal-header@2.2.0-rc.5...@twreporter/universal-header@2.2.0-rc.6) (2021-09-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* address review comment & lint error ([#212](https://github.com/twreporter/twreporter-npm-packages/issues/212)) ([c02800d](https://github.com/twreporter/twreporter-npm-packages/commit/c02800dd410ae08abbe617d31509ad18ba7cd3aa))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [2.2.0-rc.5](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/universal-header@2.2.0-rc.4...@twreporter/universal-header@2.2.0-rc.5) (2021-09-28)
|
|
7
18
|
|
|
8
19
|
|
package/lib/containers/header.js
CHANGED
|
@@ -110,25 +110,6 @@ var DesktopAndAbove = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
|
110
110
|
componentId: "narage-2"
|
|
111
111
|
})(["display:none;", ""], _mediaQuery["default"].desktopAndAbove(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: block;\n ", "\n "])), stickyTop));
|
|
112
112
|
|
|
113
|
-
function mergeTwoArraysInOrder() {
|
|
114
|
-
var arr1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
115
|
-
var arr2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
116
|
-
var rtn = [];
|
|
117
|
-
var maxLength = Math.max(arr1.length, arr2.length);
|
|
118
|
-
|
|
119
|
-
for (var i = 0; i < maxLength; i++) {
|
|
120
|
-
if (arr1[i]) {
|
|
121
|
-
rtn.push(arr1[i]);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (arr2[i]) {
|
|
125
|
-
rtn.push(arr2[i]);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return rtn;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
113
|
var Container = /*#__PURE__*/function (_React$PureComponent) {
|
|
133
114
|
_inherits(Container, _React$PureComponent);
|
|
134
115
|
|
|
@@ -148,7 +129,7 @@ var Container = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
148
129
|
|
|
149
130
|
_this.currentY = 0;
|
|
150
131
|
_this.readyY = 0;
|
|
151
|
-
_this.
|
|
132
|
+
_this.isTransforming = false;
|
|
152
133
|
_this.transformTimer = null;
|
|
153
134
|
return _this;
|
|
154
135
|
}
|
|
@@ -164,6 +145,11 @@ var Container = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
164
145
|
key: "componentWillUnmount",
|
|
165
146
|
value: function componentWillUnmount() {
|
|
166
147
|
window.removeEventListener('scroll', this.handleScroll);
|
|
148
|
+
this.handleScroll = null;
|
|
149
|
+
this.currentY = null;
|
|
150
|
+
this.readyY = null;
|
|
151
|
+
this.isTransforming = null;
|
|
152
|
+
this.transformTimer = null;
|
|
167
153
|
}
|
|
168
154
|
}, {
|
|
169
155
|
key: "__handleScroll",
|
|
@@ -188,7 +174,7 @@ var Container = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
188
174
|
return scrollState;
|
|
189
175
|
}
|
|
190
176
|
|
|
191
|
-
scrollState.toUseNarrow = scrollTop > TRANSFORM_HEADER_THRESHOLD
|
|
177
|
+
scrollState.toUseNarrow = scrollTop > TRANSFORM_HEADER_THRESHOLD;
|
|
192
178
|
|
|
193
179
|
if (scrollDirection === 'up') {
|
|
194
180
|
this.readyY = scrollTop;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twreporter/universal-header",
|
|
3
|
-
"version": "2.2.0-rc.
|
|
3
|
+
"version": "2.2.0-rc.6",
|
|
4
4
|
"description": "Universal header of TWReporter sites",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"files": [
|
|
35
35
|
"lib"
|
|
36
36
|
],
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "fb8726c9e2b313d1c9198524c340f9ef5cfcdc1b"
|
|
38
38
|
}
|