@twreporter/index-page 1.4.7 → 1.4.8-rc.0
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 +8 -0
- package/lib/index.js +2 -11
- package/package.json +4 -4
- package/lib/components/editor-picks-old.js +0 -488
- package/lib/components/latest-section-old.js +0 -172
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [1.4.8-rc.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/index-page@1.4.7...@twreporter/index-page@1.4.8-rc.0) (2023-06-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @twreporter/index-page
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [1.4.7](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/index-page@1.4.7-rc.9...@twreporter/index-page@1.4.7) (2023-06-21)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @twreporter/index-page
|
package/lib/index.js
CHANGED
|
@@ -11,16 +11,12 @@ var _donationBoxSection = _interopRequireDefault(require("./components/donation-
|
|
|
11
11
|
|
|
12
12
|
var _editorPicks = _interopRequireDefault(require("./components/editor-picks"));
|
|
13
13
|
|
|
14
|
-
var _editorPicksOld = _interopRequireDefault(require("./components/editor-picks-old"));
|
|
15
|
-
|
|
16
14
|
var _infographicSection = _interopRequireDefault(require("./components/infographic-section"));
|
|
17
15
|
|
|
18
16
|
var _juniorBoxSection = _interopRequireDefault(require("./components/junior-box-section"));
|
|
19
17
|
|
|
20
18
|
var _latestSection = _interopRequireDefault(require("./components/latest-section"));
|
|
21
19
|
|
|
22
|
-
var _latestSectionOld = _interopRequireDefault(require("./components/latest-section-old"));
|
|
23
|
-
|
|
24
20
|
var _latestTopic = _interopRequireDefault(require("./components/latest-topic"));
|
|
25
21
|
|
|
26
22
|
var _newsLetterSection = _interopRequireDefault(require("./components/news-letter-section"));
|
|
@@ -37,21 +33,16 @@ var _searchBox = _interopRequireDefault(require("./components/search-box"));
|
|
|
37
33
|
|
|
38
34
|
var _topicsSection = _interopRequireDefault(require("./components/topics-section"));
|
|
39
35
|
|
|
40
|
-
var _featureFlag = require("@twreporter/core/lib/constants/feature-flag");
|
|
41
|
-
|
|
42
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
43
37
|
|
|
44
|
-
// feature toggle
|
|
45
|
-
var LatestSection = _featureFlag.ENABLE_NEW_INFO_ARCH ? _latestSection["default"] : _latestSectionOld["default"];
|
|
46
|
-
var EditorPicks = _featureFlag.ENABLE_NEW_INFO_ARCH ? _editorPicks["default"] : _editorPicksOld["default"];
|
|
47
38
|
var _default = {
|
|
48
39
|
components: {
|
|
49
40
|
CategorySection: _categorySection["default"],
|
|
50
41
|
DonationBoxSection: _donationBoxSection["default"],
|
|
51
|
-
EditorPicks:
|
|
42
|
+
EditorPicks: _editorPicks["default"],
|
|
52
43
|
InforgraphicSection: _infographicSection["default"],
|
|
53
44
|
JuniorBoxSection: _juniorBoxSection["default"],
|
|
54
|
-
LatestSection:
|
|
45
|
+
LatestSection: _latestSection["default"],
|
|
55
46
|
LatestTopicSection: _latestTopic["default"],
|
|
56
47
|
NewsLetterSection: _newsLetterSection["default"],
|
|
57
48
|
PhotographySection: _photographySection["default"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twreporter/index-page",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.8-rc.0",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"repository": "https://github.com/twreporter/twreporter-npm-packages.git",
|
|
6
6
|
"author": "twreporter <developer@twreporter.org>",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"prepublishOnly": "make build"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@twreporter/core": "^1.10.0",
|
|
16
|
-
"@twreporter/react-components": "^8.18.0",
|
|
15
|
+
"@twreporter/core": "^1.10.1-rc.0",
|
|
16
|
+
"@twreporter/react-components": "^8.18.1-rc.0",
|
|
17
17
|
"lodash": "^4.0.0",
|
|
18
18
|
"prop-types": "^15.0.0",
|
|
19
19
|
"react": "^16.3.0",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"files": [
|
|
28
28
|
"lib"
|
|
29
29
|
],
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "d0cdc973332d7c8b7e8d8bd4370e6b789961a1a0"
|
|
31
31
|
}
|
|
@@ -1,488 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
|
-
var _post = _interopRequireDefault(require("./prop-types/post"));
|
|
15
|
-
|
|
16
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
17
|
-
|
|
18
|
-
var _getHref = require("../utils/getHref");
|
|
19
|
-
|
|
20
|
-
var _styleUtils = require("../utils/style-utils");
|
|
21
|
-
|
|
22
|
-
var _editorPicksMobile = _interopRequireDefault(require("./editor-picks-mobile"));
|
|
23
|
-
|
|
24
|
-
var _imgWrapper = _interopRequireDefault(require("./common-utils/img-wrapper"));
|
|
25
|
-
|
|
26
|
-
var _categoryName = _interopRequireDefault(require("./common-utils/category-name"));
|
|
27
|
-
|
|
28
|
-
var _sectionContentWrapper = _interopRequireDefault(require("./common-utils/section-content-wrapper"));
|
|
29
|
-
|
|
30
|
-
var _twreporterLink = _interopRequireDefault(require("./common-utils/twreporter-link"));
|
|
31
|
-
|
|
32
|
-
var _color = _interopRequireDefault(require("../constants/color"));
|
|
33
|
-
|
|
34
|
-
var _font = require("@twreporter/core/lib/constants/font");
|
|
35
|
-
|
|
36
|
-
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
37
|
-
|
|
38
|
-
var _clone = _interopRequireDefault(require("lodash/clone"));
|
|
39
|
-
|
|
40
|
-
var _get = _interopRequireDefault(require("lodash/get"));
|
|
41
|
-
|
|
42
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
|
43
|
-
|
|
44
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
45
|
-
|
|
46
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
47
|
-
|
|
48
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
49
|
-
|
|
50
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
51
|
-
|
|
52
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
53
|
-
|
|
54
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
55
|
-
|
|
56
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
57
|
-
|
|
58
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
59
|
-
|
|
60
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
61
|
-
|
|
62
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
63
|
-
|
|
64
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
65
|
-
|
|
66
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
67
|
-
|
|
68
|
-
// assets
|
|
69
|
-
var LeftArrowIcon = function LeftArrowIcon(props) {
|
|
70
|
-
return /*#__PURE__*/_react["default"].createElement("svg", props, /*#__PURE__*/_react["default"].createElement("title", null, "Left Arrow"), /*#__PURE__*/_react["default"].createElement("path", {
|
|
71
|
-
d: "M13 2.308l-10 10 10 10",
|
|
72
|
-
strokeWidth: "4",
|
|
73
|
-
stroke: "#C3000B",
|
|
74
|
-
fill: "none",
|
|
75
|
-
fillRule: "evenodd"
|
|
76
|
-
}));
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
LeftArrowIcon.defaultProps = {
|
|
80
|
-
width: "15",
|
|
81
|
-
height: "24",
|
|
82
|
-
viewBox: "0 0 15 24",
|
|
83
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
var RightArrowIcon = function RightArrowIcon(props) {
|
|
87
|
-
return /*#__PURE__*/_react["default"].createElement("svg", props, /*#__PURE__*/_react["default"].createElement("title", null, "Right Arrow"), /*#__PURE__*/_react["default"].createElement("path", {
|
|
88
|
-
d: "M2 2.308l10 10-10 10",
|
|
89
|
-
strokeWidth: "4",
|
|
90
|
-
stroke: "#C3000B",
|
|
91
|
-
fill: "none",
|
|
92
|
-
fillRule: "evenodd"
|
|
93
|
-
}));
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
RightArrowIcon.defaultProps = {
|
|
97
|
-
width: "15",
|
|
98
|
-
height: "24",
|
|
99
|
-
viewBox: "0 0 15 24",
|
|
100
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
101
|
-
}; // @twreporter
|
|
102
|
-
|
|
103
|
-
var _ = {
|
|
104
|
-
get: _get["default"],
|
|
105
|
-
clone: _clone["default"]
|
|
106
|
-
};
|
|
107
|
-
var mockup = {
|
|
108
|
-
img: {
|
|
109
|
-
sizes: {
|
|
110
|
-
desktop: '886px',
|
|
111
|
-
tablet: '450px',
|
|
112
|
-
mobile: '307px'
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
var swapArrayElements = function swapArrayElements(arr, indexA, indexB) {
|
|
118
|
-
if (Array.isArray(arr) && arr.length > 2) {
|
|
119
|
-
var newArr = _.clone(arr);
|
|
120
|
-
|
|
121
|
-
var tmp = newArr[indexA];
|
|
122
|
-
newArr[indexA] = newArr[indexB];
|
|
123
|
-
newArr[indexB] = tmp;
|
|
124
|
-
return newArr;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return arr;
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
var CarouselContainer = /*#__PURE__*/(0, _styledComponents["default"])(_sectionContentWrapper["default"]).withConfig({
|
|
131
|
-
displayName: "editor-picks-old__CarouselContainer",
|
|
132
|
-
componentId: "an7vum-0"
|
|
133
|
-
})(["overflow-x:hidden;position:relative;", ""], _mediaQuery["default"].mobileOnly(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: none;\n "]))));
|
|
134
|
-
|
|
135
|
-
var FlexContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
136
|
-
displayName: "editor-picks-old__FlexContainer",
|
|
137
|
-
componentId: "an7vum-1"
|
|
138
|
-
})(["position:relative;display:flex;height:932px;align-items:center;", ""], _mediaQuery["default"].desktopAndBelow(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: 702px;\n "])))); // FlexItem is for moving Title
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
var FlexItem = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
142
|
-
displayName: "editor-picks-old__FlexItem",
|
|
143
|
-
componentId: "an7vum-2"
|
|
144
|
-
})(["flex:0 0 20%;margin-right:20%;position:relative;transform:", ";transition:500ms transform ease-in,500ms margin-top ease-in;cursor:pointer;margin-top:", ";", " z-index:2;"], function (props) {
|
|
145
|
-
return props.selected !== 0 ? "translateX(-".concat((props.selected - 1) * 200, "%)") : 'translateX(200%)';
|
|
146
|
-
}, function (props) {
|
|
147
|
-
return props.middle ? '-770px' : '16px';
|
|
148
|
-
}, _mediaQuery["default"].desktopAndBelow(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-top: ", ";\n "])), function (props) {
|
|
149
|
-
return props.middle ? '-540px' : '16px';
|
|
150
|
-
}));
|
|
151
|
-
|
|
152
|
-
var ImgFrame = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
153
|
-
displayName: "editor-picks-old__ImgFrame",
|
|
154
|
-
componentId: "an7vum-3"
|
|
155
|
-
})(["cursor:pointer;position:absolute;width:886px;height:570px;left:50%;top:236px;transform:translateX(-50%);", " ", ""], _mediaQuery["default"].desktopOnly(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 610px;\n height: 391px;\n "]))), _mediaQuery["default"].tabletOnly(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n width: 450px;\n height: 295px;\n "]))));
|
|
156
|
-
|
|
157
|
-
var Arrow = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
158
|
-
displayName: "editor-picks-old__Arrow",
|
|
159
|
-
componentId: "an7vum-4"
|
|
160
|
-
})(["cursor:pointer;position:absolute;top:480px;"]); // top: sideCategory + 27px
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
var LeftArrow = /*#__PURE__*/(0, _styledComponents["default"])(Arrow).withConfig({
|
|
164
|
-
displayName: "editor-picks-old__LeftArrow",
|
|
165
|
-
componentId: "an7vum-5"
|
|
166
|
-
})(["left:17%;display:", ";", " transition:0.2s display linear;"], function (props) {
|
|
167
|
-
return props.selected === 0 ? 'none' : 'inline';
|
|
168
|
-
}, _mediaQuery["default"].desktopAndBelow(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n top: 365px;\n "]))));
|
|
169
|
-
var RightArrow = /*#__PURE__*/(0, _styledComponents["default"])(Arrow).withConfig({
|
|
170
|
-
displayName: "editor-picks-old__RightArrow",
|
|
171
|
-
componentId: "an7vum-6"
|
|
172
|
-
})(["right:17%;display:", ";", " transition:0.2s display linear;"], function (props) {
|
|
173
|
-
return props.selected === props.dataLength - 1 ? 'none' : 'inline';
|
|
174
|
-
}, _mediaQuery["default"].desktopAndBelow(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n top: 365px;\n "]))));
|
|
175
|
-
var SideCategory = /*#__PURE__*/(0, _styledComponents["default"])(_categoryName["default"]).withConfig({
|
|
176
|
-
displayName: "editor-picks-old__SideCategory",
|
|
177
|
-
componentId: "an7vum-7"
|
|
178
|
-
})(["text-align:center;height:16px;line-height:1.33;position:absolute;width:auto;transform:translateX(-50%);text-align:center;width:161px;height:16px;top:453px;left:", ";", ""], function (props) {
|
|
179
|
-
return props.left ? props.left : '0';
|
|
180
|
-
}, _mediaQuery["default"].desktopAndBelow(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n top: 338px;\n "]))));
|
|
181
|
-
var MiddleCategory = /*#__PURE__*/(0, _styledComponents["default"])(_categoryName["default"]).withConfig({
|
|
182
|
-
displayName: "editor-picks-old__MiddleCategory",
|
|
183
|
-
componentId: "an7vum-8"
|
|
184
|
-
})(["text-align:center;height:16px;line-height:1.33;position:absolute;top:", ";left:", ";width:auto;transform:translateX(-50%);text-align:center;width:161px;height:16px;"], function (props) {
|
|
185
|
-
return props.top ? props.top : '0';
|
|
186
|
-
}, function (props) {
|
|
187
|
-
return props.left ? props.left : '0';
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
var Title = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
191
|
-
displayName: "editor-picks-old__Title",
|
|
192
|
-
componentId: "an7vum-9"
|
|
193
|
-
})(["font-size:", ";font-weight:", ";font-family:", ";color:", ";width:", ";position:absolute;text-align:center;line-height:", ";max-height:", ";top:0;left:50%;transform:translateX(-50%);overflow:hidden;line-break:anywhere;", " ", ""], function (props) {
|
|
194
|
-
return props.middle ? "32px" : "16px";
|
|
195
|
-
}, _font.fontWeight.bold, _font.fontFamily.title, _color["default"].darkGray, function (props) {
|
|
196
|
-
return props.middle ? '450px' : '150px';
|
|
197
|
-
}, function (props) {
|
|
198
|
-
return props.middle ? '1.25' : '1.25';
|
|
199
|
-
}, function (props) {
|
|
200
|
-
return props.middle ? '2.5' : '7.5';
|
|
201
|
-
}, _mediaQuery["default"].desktopOnly(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n width: ", ";\n "])), function (props) {
|
|
202
|
-
return props.middle ? '450px' : '120px';
|
|
203
|
-
}), _mediaQuery["default"].tabletAndBelow(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n width: ", ";\n "])), function (props) {
|
|
204
|
-
return props.middle ? '450px' : '90px';
|
|
205
|
-
}));
|
|
206
|
-
|
|
207
|
-
var Description = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
208
|
-
displayName: "editor-picks-old__Description",
|
|
209
|
-
componentId: "an7vum-10"
|
|
210
|
-
})(["position:absolute;font-size:16px;width:450px;top:", ";left:", ";color:", ";transform:translateX(-50%);", ";", " z-index:2;"], function (props) {
|
|
211
|
-
return props.top ? props.top : '0';
|
|
212
|
-
}, function (props) {
|
|
213
|
-
return props.left ? props.left : '0';
|
|
214
|
-
}, _color["default"].darkGray, (0, _styleUtils.truncate)('absolute', 1.43, 2, 'white'), _mediaQuery["default"].tabletAndAbove(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n ", "\n transition: .2s opacity linear;\n "])), function (props) {
|
|
215
|
-
return props.ifHover ? 'opacity: 0.7;' : '';
|
|
216
|
-
}));
|
|
217
|
-
|
|
218
|
-
var HoverEffect = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
219
|
-
displayName: "editor-picks-old__HoverEffect",
|
|
220
|
-
componentId: "an7vum-11"
|
|
221
|
-
})(["cursor:pointer;text-decoration:none;color:", ";", ""], _color["default"].darkGray, _mediaQuery["default"].tabletAndAbove(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n ", "\n transition: .2s opacity linear;\n "])), function (props) {
|
|
222
|
-
return props.ifHover ? 'opacity: 0.7;' : 'opacity: 1;';
|
|
223
|
-
}));
|
|
224
|
-
|
|
225
|
-
var FadeInFadeOut = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
226
|
-
displayName: "editor-picks-old__FadeInFadeOut",
|
|
227
|
-
componentId: "an7vum-12"
|
|
228
|
-
})(["opacity:", ";z-index:", ";transition:150ms opacity ease-in-out;"], function (props) {
|
|
229
|
-
return props.isSelected ? '1' : '0';
|
|
230
|
-
}, function (props) {
|
|
231
|
-
return props.isSelected ? '1' : '0';
|
|
232
|
-
}); // this is a container
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
var EditorPicks = /*#__PURE__*/function (_React$Component) {
|
|
236
|
-
_inherits(EditorPicks, _React$Component);
|
|
237
|
-
|
|
238
|
-
var _super = _createSuper(EditorPicks);
|
|
239
|
-
|
|
240
|
-
function EditorPicks(props) {
|
|
241
|
-
var _this;
|
|
242
|
-
|
|
243
|
-
_classCallCheck(this, EditorPicks);
|
|
244
|
-
|
|
245
|
-
_this = _super.call(this, props);
|
|
246
|
-
_this.state = {
|
|
247
|
-
selected: 1,
|
|
248
|
-
ifHover: false
|
|
249
|
-
};
|
|
250
|
-
_this.onShiftToLeft = _this._onShiftToLeft.bind(_assertThisInitialized(_this));
|
|
251
|
-
_this.onShiftToRight = _this._onShiftToRight.bind(_assertThisInitialized(_this));
|
|
252
|
-
_this.handleOnMouseEnter = _this._handleOnMouseEnter.bind(_assertThisInitialized(_this));
|
|
253
|
-
_this.handleOnMouseLeave = _this._handleOnMouseLeave.bind(_assertThisInitialized(_this));
|
|
254
|
-
return _this;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
_createClass(EditorPicks, [{
|
|
258
|
-
key: "_onShiftToLeft",
|
|
259
|
-
value: function _onShiftToLeft() {
|
|
260
|
-
if (this.state.selected + 1 < this.props.data.length) {
|
|
261
|
-
this.setState({
|
|
262
|
-
selected: this.state.selected + 1
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}, {
|
|
267
|
-
key: "_onShiftToRight",
|
|
268
|
-
value: function _onShiftToRight() {
|
|
269
|
-
if (this.state.selected > 0) {
|
|
270
|
-
this.setState({
|
|
271
|
-
selected: this.state.selected - 1
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}, {
|
|
276
|
-
key: "_handleOnMouseEnter",
|
|
277
|
-
value: function _handleOnMouseEnter() {
|
|
278
|
-
this.setState({
|
|
279
|
-
ifHover: true
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
}, {
|
|
283
|
-
key: "_handleOnMouseLeave",
|
|
284
|
-
value: function _handleOnMouseLeave() {
|
|
285
|
-
this.setState({
|
|
286
|
-
ifHover: false
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
}, {
|
|
290
|
-
key: "render",
|
|
291
|
-
value: function render() {
|
|
292
|
-
var _this2 = this;
|
|
293
|
-
|
|
294
|
-
var data = this.props.data;
|
|
295
|
-
var swappedData = swapArrayElements(data, 0, 1);
|
|
296
|
-
|
|
297
|
-
var getTruncate = function getTruncate(title) {
|
|
298
|
-
if (title.length > 25) {
|
|
299
|
-
return "".concat(title.slice(0, 24), "...");
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
return title;
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
var FlexItems = function () {
|
|
306
|
-
return swappedData.map(function (obj, i) {
|
|
307
|
-
var isExternal = _.get(obj, 'is_external', false);
|
|
308
|
-
|
|
309
|
-
var href = (0, _getHref.getHref)(_.get(obj, 'slug', 'error'), isExternal);
|
|
310
|
-
var propsMap = {
|
|
311
|
-
middle: false,
|
|
312
|
-
onClick: function onClick() {}
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
if (i === _this2.state.selected - 1) {
|
|
316
|
-
propsMap.onClick = _this2.onShiftToRight;
|
|
317
|
-
} else if (i === _this2.state.selected) {
|
|
318
|
-
propsMap.middle = true;
|
|
319
|
-
|
|
320
|
-
propsMap.onClick = function () {};
|
|
321
|
-
} else if (i === _this2.state.selected + 1) {
|
|
322
|
-
propsMap.onClick = _this2.onShiftToLeft;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
return /*#__PURE__*/_react["default"].createElement(FlexItem, {
|
|
326
|
-
key: "key_".concat(obj.title),
|
|
327
|
-
middle: propsMap.middle,
|
|
328
|
-
selected: _this2.state.selected,
|
|
329
|
-
onClick: function onClick() {
|
|
330
|
-
propsMap.onClick("a/".concat(_.get(obj, 'slug', 'error')));
|
|
331
|
-
}
|
|
332
|
-
}, i === _this2.state.selected ? /*#__PURE__*/_react["default"].createElement(_twreporterLink["default"], {
|
|
333
|
-
href: href,
|
|
334
|
-
redirect: isExternal,
|
|
335
|
-
plain: true
|
|
336
|
-
}, /*#__PURE__*/_react["default"].createElement(HoverEffect, {
|
|
337
|
-
ifHover: _this2.state.ifHover
|
|
338
|
-
}, /*#__PURE__*/_react["default"].createElement(Title, {
|
|
339
|
-
middle: propsMap.middle,
|
|
340
|
-
onMouseOver: _this2.handleOnMouseEnter,
|
|
341
|
-
onMouseLeave: _this2.handleOnMouseLeave
|
|
342
|
-
}, /*#__PURE__*/_react["default"].createElement("div", null, propsMap.middle ? getTruncate(obj.title) : obj.title)))) : /*#__PURE__*/_react["default"].createElement(Title, {
|
|
343
|
-
middle: propsMap.middle
|
|
344
|
-
}, /*#__PURE__*/_react["default"].createElement("div", null, propsMap.middle ? getTruncate(obj.title) : obj.title)));
|
|
345
|
-
});
|
|
346
|
-
}();
|
|
347
|
-
|
|
348
|
-
var Types = function () {
|
|
349
|
-
// type: left, middle, right. description: middle
|
|
350
|
-
var propList = [{
|
|
351
|
-
position: 'left',
|
|
352
|
-
component: SideCategory,
|
|
353
|
-
propsForComponent: {
|
|
354
|
-
top: null,
|
|
355
|
-
left: '10%'
|
|
356
|
-
},
|
|
357
|
-
dataPath: 'categories[0].name'
|
|
358
|
-
}, {
|
|
359
|
-
position: 'middle',
|
|
360
|
-
component: MiddleCategory,
|
|
361
|
-
propsForComponent: {
|
|
362
|
-
top: '60px',
|
|
363
|
-
left: '50%'
|
|
364
|
-
},
|
|
365
|
-
dataPath: 'categories[0].name'
|
|
366
|
-
}, {
|
|
367
|
-
position: 'right',
|
|
368
|
-
middle: false,
|
|
369
|
-
component: SideCategory,
|
|
370
|
-
propsForComponent: {
|
|
371
|
-
top: null,
|
|
372
|
-
left: '90%'
|
|
373
|
-
},
|
|
374
|
-
dataPath: 'categories[0].name'
|
|
375
|
-
}, {
|
|
376
|
-
position: 'middle',
|
|
377
|
-
component: Description,
|
|
378
|
-
propsForComponent: {
|
|
379
|
-
top: '171px',
|
|
380
|
-
left: '50%'
|
|
381
|
-
},
|
|
382
|
-
dataPath: 'og_description'
|
|
383
|
-
}];
|
|
384
|
-
return propList.map(function (theProp) {
|
|
385
|
-
return swappedData.map(function (post, index) {
|
|
386
|
-
var isExternal = _.get(post, 'is_external', false);
|
|
387
|
-
|
|
388
|
-
var href = (0, _getHref.getHref)(_.get(post, 'slug', 'error'), isExternal);
|
|
389
|
-
|
|
390
|
-
var currentData = _.get(post, theProp.dataPath, '');
|
|
391
|
-
|
|
392
|
-
var selectDataToShow = {
|
|
393
|
-
left: _this2.state.selected - 1,
|
|
394
|
-
middle: _this2.state.selected,
|
|
395
|
-
right: _this2.state.selected + 1
|
|
396
|
-
};
|
|
397
|
-
var fadingStyle = {
|
|
398
|
-
opacity: index === selectDataToShow[theProp.position] ? '1' : '0',
|
|
399
|
-
zIndex: index === selectDataToShow[theProp.position] ? '1' : '0',
|
|
400
|
-
transition: 'opacity 150ms ease-in-out'
|
|
401
|
-
};
|
|
402
|
-
return /*#__PURE__*/_react["default"].createElement(FadeInFadeOut, {
|
|
403
|
-
key: _.get(post, 'id'),
|
|
404
|
-
isSelected: index === selectDataToShow[theProp.position]
|
|
405
|
-
}, theProp.dataPath === 'og_description' ? /*#__PURE__*/_react["default"].createElement(_twreporterLink["default"], {
|
|
406
|
-
href: href,
|
|
407
|
-
redirect: isExternal,
|
|
408
|
-
plain: true
|
|
409
|
-
}, /*#__PURE__*/_react["default"].createElement(theProp.component, {
|
|
410
|
-
ifHover: _this2.state.ifHover,
|
|
411
|
-
top: theProp.propsForComponent.top,
|
|
412
|
-
left: theProp.propsForComponent.left,
|
|
413
|
-
onMouseEnter: _this2.handleOnMouseEnter,
|
|
414
|
-
onMouseLeave: _this2.handleOnMouseLeave // Adds fade-in fade-out inline style for IE and Edge
|
|
415
|
-
,
|
|
416
|
-
style: fadingStyle
|
|
417
|
-
}, currentData)) : /*#__PURE__*/_react["default"].createElement(theProp.component, {
|
|
418
|
-
top: theProp.propsForComponent.top,
|
|
419
|
-
left: theProp.propsForComponent.left // Adds fade-in fade-out inline style for IE and Edge
|
|
420
|
-
,
|
|
421
|
-
style: fadingStyle
|
|
422
|
-
}, currentData));
|
|
423
|
-
});
|
|
424
|
-
});
|
|
425
|
-
}();
|
|
426
|
-
|
|
427
|
-
var Images = swappedData.map(function (post, index) {
|
|
428
|
-
var imgObj = _.get(post, 'hero_image') || _.get(post, 'og_image');
|
|
429
|
-
|
|
430
|
-
var isExternal = _.get(post, 'is_external', false);
|
|
431
|
-
|
|
432
|
-
var href = (0, _getHref.getHref)(_.get(post, 'slug', 'error'), isExternal);
|
|
433
|
-
var fadingStyle = {
|
|
434
|
-
opacity: _this2.state.selected === index ? '1' : '0',
|
|
435
|
-
zIndex: _this2.state.selected === index ? '1' : '0',
|
|
436
|
-
transition: 'opacity .5s linear'
|
|
437
|
-
};
|
|
438
|
-
return /*#__PURE__*/_react["default"].createElement(FadeInFadeOut, {
|
|
439
|
-
key: _.get(imgObj, 'id'),
|
|
440
|
-
isSelected: index === _this2.state.selected
|
|
441
|
-
}, /*#__PURE__*/_react["default"].createElement(_twreporterLink["default"], {
|
|
442
|
-
href: href,
|
|
443
|
-
redirect: isExternal,
|
|
444
|
-
plain: true
|
|
445
|
-
}, /*#__PURE__*/_react["default"].createElement(HoverEffect, {
|
|
446
|
-
ifHover: _this2.state.ifHover
|
|
447
|
-
}, /*#__PURE__*/_react["default"].createElement(ImgFrame, {
|
|
448
|
-
onMouseEnter: _this2.handleOnMouseEnter,
|
|
449
|
-
onMouseLeave: _this2.handleOnMouseLeave // Adds fade-in fade-out inline style for IE and Edge
|
|
450
|
-
,
|
|
451
|
-
style: fadingStyle
|
|
452
|
-
}, /*#__PURE__*/_react["default"].createElement(_imgWrapper["default"], {
|
|
453
|
-
alt: _.get(imgObj, 'description'),
|
|
454
|
-
src: _.get(imgObj, 'resized_targets.tablet.url'),
|
|
455
|
-
srcSet: _.get(imgObj, 'resized_targets'),
|
|
456
|
-
sizes: "(min-width: ".concat(_styleUtils.breakPoints.desktopMinWidth, ") ").concat(mockup.img.sizes.desktop, ", ") + "(min-width: ".concat(_styleUtils.breakPoints.tabletMinWidth, ") ").concat(mockup.img.sizes.tablet, ", ") + "".concat(mockup.img.sizes.mobile)
|
|
457
|
-
})))));
|
|
458
|
-
});
|
|
459
|
-
|
|
460
|
-
var Arrows = function () {
|
|
461
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(LeftArrow, {
|
|
462
|
-
onClick: _this2.onShiftToRight,
|
|
463
|
-
selected: _this2.state.selected
|
|
464
|
-
}, /*#__PURE__*/_react["default"].createElement(LeftArrowIcon, null)), /*#__PURE__*/_react["default"].createElement(RightArrow, {
|
|
465
|
-
onClick: _this2.onShiftToLeft,
|
|
466
|
-
selected: _this2.state.selected,
|
|
467
|
-
dataLength: _this2.props.data.length
|
|
468
|
-
}, /*#__PURE__*/_react["default"].createElement(RightArrowIcon, null)));
|
|
469
|
-
}();
|
|
470
|
-
|
|
471
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(CarouselContainer, null, /*#__PURE__*/_react["default"].createElement(FlexContainer, null, Types, Arrows, Images, FlexItems)), /*#__PURE__*/_react["default"].createElement(_editorPicksMobile["default"], {
|
|
472
|
-
data: this.props.data,
|
|
473
|
-
maxSwipableItems: 5
|
|
474
|
-
}));
|
|
475
|
-
}
|
|
476
|
-
}]);
|
|
477
|
-
|
|
478
|
-
return EditorPicks;
|
|
479
|
-
}(_react["default"].Component);
|
|
480
|
-
|
|
481
|
-
EditorPicks.defaultProps = {
|
|
482
|
-
data: []
|
|
483
|
-
};
|
|
484
|
-
EditorPicks.propTypes = {
|
|
485
|
-
data: _propTypes["default"].arrayOf((0, _post["default"])())
|
|
486
|
-
};
|
|
487
|
-
var _default = EditorPicks;
|
|
488
|
-
exports["default"] = _default;
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
|
-
var _post = _interopRequireDefault(require("./prop-types/post"));
|
|
15
|
-
|
|
16
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
17
|
-
|
|
18
|
-
var _getHref = require("../utils/getHref");
|
|
19
|
-
|
|
20
|
-
var _styleUtils = require("../utils/style-utils");
|
|
21
|
-
|
|
22
|
-
var _categoryName = _interopRequireDefault(require("./common-utils/category-name"));
|
|
23
|
-
|
|
24
|
-
var _imgWrapper = _interopRequireDefault(require("./common-utils/img-wrapper"));
|
|
25
|
-
|
|
26
|
-
var _sectionContentWrapper = _interopRequireDefault(require("./common-utils/section-content-wrapper"));
|
|
27
|
-
|
|
28
|
-
var _twreporterLink = _interopRequireDefault(require("./common-utils/twreporter-link"));
|
|
29
|
-
|
|
30
|
-
var _color = _interopRequireDefault(require("../constants/color"));
|
|
31
|
-
|
|
32
|
-
var _font = require("@twreporter/core/lib/constants/font");
|
|
33
|
-
|
|
34
|
-
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
35
|
-
|
|
36
|
-
var _get = _interopRequireDefault(require("lodash/get"));
|
|
37
|
-
|
|
38
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
39
|
-
|
|
40
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
41
|
-
|
|
42
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
43
|
-
|
|
44
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
45
|
-
|
|
46
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
47
|
-
|
|
48
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
49
|
-
|
|
50
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
51
|
-
|
|
52
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
53
|
-
|
|
54
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
55
|
-
|
|
56
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
57
|
-
|
|
58
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
59
|
-
|
|
60
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
61
|
-
|
|
62
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
63
|
-
|
|
64
|
-
var _ = {
|
|
65
|
-
get: _get["default"]
|
|
66
|
-
};
|
|
67
|
-
var desktopMinWidth = _styleUtils.breakPoints.desktopMinWidth;
|
|
68
|
-
var tabletMinWidth = _styleUtils.breakPoints.tabletMinWidth;
|
|
69
|
-
var mobileMidWidth = '578px';
|
|
70
|
-
var mobileSemiMidWidth = '414px';
|
|
71
|
-
var mobileMinWidth = '320px';
|
|
72
|
-
var mockup = {
|
|
73
|
-
img: {
|
|
74
|
-
sizes: {
|
|
75
|
-
desktop: '199px',
|
|
76
|
-
tablet: '160px',
|
|
77
|
-
mobile: '136px'
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
var headerPadding = {
|
|
82
|
-
desktop: '47px',
|
|
83
|
-
tablet: '34px',
|
|
84
|
-
mobile: '16px'
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
var Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
88
|
-
displayName: "latest-section-old__Container",
|
|
89
|
-
componentId: "sc-1ho0gdl-0"
|
|
90
|
-
})(["background-color:", ";position:relative;", ""], _color["default"].lightGray, _mediaQuery["default"].mobileOnly(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 0;\n "]))));
|
|
91
|
-
|
|
92
|
-
var ContentContainer = /*#__PURE__*/(0, _styledComponents["default"])(_sectionContentWrapper["default"]).withConfig({
|
|
93
|
-
displayName: "latest-section-old__ContentContainer",
|
|
94
|
-
componentId: "sc-1ho0gdl-1"
|
|
95
|
-
})(["display:flex;padding:30px ", ";overflow-x:hidden;justify-content:center;", " ", ""], headerPadding.desktop, _mediaQuery["default"].tabletOnly(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 30px ", ";\n "])), headerPadding.tablet), _mediaQuery["default"].mobileOnly(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 30px ", ";\n "])), headerPadding.mobile));
|
|
96
|
-
|
|
97
|
-
var ItemFrame = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
98
|
-
displayName: "latest-section-old__ItemFrame",
|
|
99
|
-
componentId: "sc-1ho0gdl-2"
|
|
100
|
-
})(["width:199px;padding:0;margin-left:30px;&:first-child{margin:0;}", " ", " ", " @media (max-width:", "){&:nth-child(4){display:none;}}@media (max-width:", "){&:nth-child(3){display:none;}}@media (max-width:", "){width:136px;margin-left:16px;}"], _mediaQuery["default"].desktopOnly(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 130px;\n "]))), _mediaQuery["default"].tabletAndBelow(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n &:nth-child(6) {\n display: none;\n }\n &:nth-child(5) {\n display: none;\n }\n "]))), _mediaQuery["default"].tabletOnly(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 160px;\n margin-left: 20px;\n "]))), mobileMidWidth, mobileSemiMidWidth, mobileMinWidth);
|
|
101
|
-
|
|
102
|
-
var ImageFrame = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
103
|
-
displayName: "latest-section-old__ImageFrame",
|
|
104
|
-
componentId: "sc-1ho0gdl-3"
|
|
105
|
-
})(["width:100%;height:128px;background:", ";background-size:cover;background-position:center;display:block;", " ", " ", " @media (max-width:", "){height:93px;}@media (max-width:", "){height:88px;}"], function (props) {
|
|
106
|
-
return props.background ? "url(".concat(props.background, ")") : 'backgroun-image';
|
|
107
|
-
}, _mediaQuery["default"].desktopOnly(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n height: 90px;\n "]))), _mediaQuery["default"].tabletOnly(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n height: 110px;\n "]))), _mediaQuery["default"].mobileOnly(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n height: 100px;\n "]))), mobileSemiMidWidth, mobileMinWidth);
|
|
108
|
-
|
|
109
|
-
var ContentFrame = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
110
|
-
displayName: "latest-section-old__ContentFrame",
|
|
111
|
-
componentId: "sc-1ho0gdl-4"
|
|
112
|
-
})(["margin:0 auto;"]);
|
|
113
|
-
|
|
114
|
-
var Category = /*#__PURE__*/(0, _styledComponents["default"])(_categoryName["default"]).withConfig({
|
|
115
|
-
displayName: "latest-section-old__Category",
|
|
116
|
-
componentId: "sc-1ho0gdl-5"
|
|
117
|
-
})(["height:16px;line-height:1.33;margin-top:12px;margin-bottom:4px;"]);
|
|
118
|
-
|
|
119
|
-
var Title = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
120
|
-
displayName: "latest-section-old__Title",
|
|
121
|
-
componentId: "sc-1ho0gdl-6"
|
|
122
|
-
})(["height:auto;font-size:16px;font-weight:", ";font-family:", ";color:", ";"], _font.fontWeight.bold, _font.fontFamily.title, _color["default"].darkGray);
|
|
123
|
-
|
|
124
|
-
var LatestSection = /*#__PURE__*/function (_React$Component) {
|
|
125
|
-
_inherits(LatestSection, _React$Component);
|
|
126
|
-
|
|
127
|
-
var _super = _createSuper(LatestSection);
|
|
128
|
-
|
|
129
|
-
function LatestSection() {
|
|
130
|
-
_classCallCheck(this, LatestSection);
|
|
131
|
-
|
|
132
|
-
return _super.apply(this, arguments);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
_createClass(LatestSection, [{
|
|
136
|
-
key: "render",
|
|
137
|
-
value: function render() {
|
|
138
|
-
var latestItems = this.props.data.map(function (item) {
|
|
139
|
-
var isExternal = _.get(item, 'is_external', false);
|
|
140
|
-
|
|
141
|
-
var href = (0, _getHref.getHref)(_.get(item, 'slug', 'error'), isExternal);
|
|
142
|
-
|
|
143
|
-
var imgObj = _.get(item, 'hero_image') || _.get(item, 'og_image');
|
|
144
|
-
|
|
145
|
-
return /*#__PURE__*/_react["default"].createElement(ItemFrame, {
|
|
146
|
-
key: _.get(item, 'id')
|
|
147
|
-
}, /*#__PURE__*/_react["default"].createElement(_twreporterLink["default"], {
|
|
148
|
-
href: href,
|
|
149
|
-
redirect: isExternal
|
|
150
|
-
}, /*#__PURE__*/_react["default"].createElement(ImageFrame, null, /*#__PURE__*/_react["default"].createElement(_imgWrapper["default"], {
|
|
151
|
-
alt: _.get(imgObj, 'description'),
|
|
152
|
-
src: _.get(imgObj, 'resized_targets.mobile.url'),
|
|
153
|
-
srcSet: _.get(imgObj, 'resized_targets'),
|
|
154
|
-
sizes: "(min-width: ".concat(desktopMinWidth, ") ").concat(mockup.img.sizes.desktop, ", ") + "(min-width: ".concat(tabletMinWidth, ") ").concat(mockup.img.sizes.tablet, ", ") + "".concat(mockup.img.sizes.mobile)
|
|
155
|
-
})), /*#__PURE__*/_react["default"].createElement(ContentFrame, null, /*#__PURE__*/_react["default"].createElement(Category, null, _.get(item, 'categories[0].name', '')), /*#__PURE__*/_react["default"].createElement(Title, null, _.get(item, 'title', '')))));
|
|
156
|
-
});
|
|
157
|
-
return /*#__PURE__*/_react["default"].createElement(Container, null, /*#__PURE__*/_react["default"].createElement(ContentContainer, null, latestItems));
|
|
158
|
-
}
|
|
159
|
-
}]);
|
|
160
|
-
|
|
161
|
-
return LatestSection;
|
|
162
|
-
}(_react["default"].Component);
|
|
163
|
-
|
|
164
|
-
LatestSection.defaultProps = {
|
|
165
|
-
data: [],
|
|
166
|
-
moduleMap: {}
|
|
167
|
-
};
|
|
168
|
-
LatestSection.propTypes = {
|
|
169
|
-
data: _propTypes["default"].arrayOf((0, _post["default"])())
|
|
170
|
-
};
|
|
171
|
-
var _default = LatestSection;
|
|
172
|
-
exports["default"] = _default;
|