@twreporter/index-page 2.0.2 → 2.0.3-rc.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.
- package/CHANGELOG.md +16 -0
- package/lib/components/animations/scroll-fadein.js +17 -44
- package/lib/components/animations/section-animation-wrapper.js +19 -44
- package/lib/components/category-section.js +12 -61
- package/lib/components/common-utils/bottom-link.js +10 -34
- package/lib/components/common-utils/category-name.js +1 -7
- package/lib/components/common-utils/hover-effect.js +1 -8
- package/lib/components/common-utils/img-placeholder.js +2 -12
- package/lib/components/common-utils/img-wrapper.js +11 -43
- package/lib/components/common-utils/section-content-wrapper.js +1 -10
- package/lib/components/common-utils/section-name.js +1 -10
- package/lib/components/common-utils/section.js +1 -9
- package/lib/components/common-utils/swipable-mixin.js +5 -28
- package/lib/components/common-utils/twreporter-link.js +5 -18
- package/lib/components/donation-box-section.js +5 -40
- package/lib/components/editor-picks-mobile.js +10 -51
- package/lib/components/editor-picks.js +21 -83
- package/lib/components/infographic-section.js +18 -75
- package/lib/components/junior-box-section.js +6 -42
- package/lib/components/latest-section.js +9 -52
- package/lib/components/latest-topic.js +16 -77
- package/lib/components/mobile-swiper-list.js +5 -17
- package/lib/components/photography-section.js +29 -90
- package/lib/components/podcast-box-section.js +6 -43
- package/lib/components/prop-types/image.js +1 -7
- package/lib/components/prop-types/post.js +7 -13
- package/lib/components/prop-types/topic.js +7 -14
- package/lib/components/reviews.js +13 -62
- package/lib/components/topics-section.js +20 -100
- package/lib/constants/app.js +2 -3
- package/lib/constants/category-strings.js +2 -6
- package/lib/constants/mobile-mockup-specification.js +10 -9
- package/lib/constants/section-strings.js +2 -6
- package/lib/constants/strings.js +1 -2
- package/lib/index.js +2 -17
- package/lib/styles/animation.js +2 -6
- package/lib/utils/getHref.js +2 -5
- package/lib/utils/image-processor.js +4 -12
- package/lib/utils/style-utils.js +3 -6
- package/package.json +3 -3
|
@@ -1,54 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
|
|
14
10
|
var _app = _interopRequireDefault(require("../constants/app"));
|
|
15
|
-
|
|
16
11
|
var _podcastLink = _interopRequireDefault(require("@twreporter/react-components/lib/podcast-link"));
|
|
17
|
-
|
|
18
12
|
var _font = require("@twreporter/core/lib/constants/font");
|
|
19
|
-
|
|
20
13
|
var _releaseBranch = require("@twreporter/core/lib/constants/release-branch");
|
|
21
|
-
|
|
22
14
|
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
23
|
-
|
|
24
15
|
var _color = require("@twreporter/core/lib/constants/color");
|
|
25
|
-
|
|
26
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
27
|
-
|
|
16
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9; // constants
|
|
28
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
|
-
|
|
30
18
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
31
|
-
|
|
32
|
-
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); } }
|
|
33
|
-
|
|
19
|
+
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
34
20
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
35
|
-
|
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
22
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
36
23
|
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
37
|
-
|
|
38
24
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
39
|
-
|
|
40
25
|
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); }; }
|
|
41
|
-
|
|
42
26
|
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); }
|
|
43
|
-
|
|
44
27
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
45
|
-
|
|
46
28
|
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; } }
|
|
47
|
-
|
|
48
29
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
49
|
-
|
|
50
30
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
51
|
-
|
|
52
31
|
// assets
|
|
53
32
|
var ArrowIcon = function ArrowIcon(props) {
|
|
54
33
|
return /*#__PURE__*/_react["default"].createElement("svg", props, /*#__PURE__*/_react["default"].createElement("title", null, "ic/chevron_right"), /*#__PURE__*/_react["default"].createElement("defs", null, /*#__PURE__*/_react["default"].createElement("path", {
|
|
@@ -69,7 +48,6 @@ var ArrowIcon = function ArrowIcon(props) {
|
|
|
69
48
|
d: "M-8-6h24v24H-8z"
|
|
70
49
|
}))));
|
|
71
50
|
};
|
|
72
|
-
|
|
73
51
|
ArrowIcon.defaultProps = {
|
|
74
52
|
width: "8",
|
|
75
53
|
height: "12",
|
|
@@ -77,13 +55,11 @@ ArrowIcon.defaultProps = {
|
|
|
77
55
|
xmlns: "http://www.w3.org/2000/svg",
|
|
78
56
|
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
79
57
|
}; // @twreporter
|
|
80
|
-
|
|
81
58
|
var mockup = {
|
|
82
59
|
defaultWidth: 320,
|
|
83
60
|
contentWidth: 238
|
|
84
61
|
};
|
|
85
62
|
var mobileContentWidthPct = mockup.contentWidth / mockup.defaultWidth * 100;
|
|
86
|
-
|
|
87
63
|
var Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
88
64
|
displayName: "podcast-box-section__Container",
|
|
89
65
|
componentId: "sc-16lji0u-0"
|
|
@@ -96,40 +72,30 @@ var Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
|
96
72
|
}), _mediaQuery["default"].hdOnly(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background-image: ", ";\n "])), function (props) {
|
|
97
73
|
return "url(".concat(_app["default"].assetsPath, "/").concat(props.$releaseBranch, "/PodcastBox_DesktopHD.jpg)");
|
|
98
74
|
}));
|
|
99
|
-
|
|
100
75
|
var ContentContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
101
76
|
displayName: "podcast-box-section__ContentContainer",
|
|
102
77
|
componentId: "sc-16lji0u-1"
|
|
103
78
|
})(["display:flex;justify-content:space-between;align-items:center;max-width:1024px;margin:0 auto;padding:0 100px;color:", ";font-family:", ";h3{margin:0;font-size:32px;font-weight:", ";font-family:", ";line-height:1.63;}p{margin-top:10px;font-size:14px;line-height:1.57;text-align:left;}", " ", " ", ""], _color.colorGrayscale.black, _font.fontFamily["default"], _font.fontWeight.bold, _font.fontFamily.title, _mediaQuery["default"].hdOnly(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n max-width: 1440px;\n padding: 0 219px;\n "]))), _mediaQuery["default"].tabletOnly(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: relative;\n padding: 0 110px;\n p{\n margin-top: 17px;\n }\n "]))), _mediaQuery["default"].mobileOnly(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n max-width: ", "%;\n display: block;\n text-align: center;\n padding: 0;\n h3{\n font-size: 24px;\n line-height: 2.17;\n }\n p{\n margin-top: 0;\n }\n "])), mobileContentWidthPct));
|
|
104
|
-
|
|
105
79
|
var ListenButton = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
106
80
|
displayName: "podcast-box-section__ListenButton",
|
|
107
81
|
componentId: "sc-16lji0u-2"
|
|
108
82
|
})(["a{width:116px;height:40px;border-radius:20px;background:", ";border:none;color:", ";font-size:16px;cursor:pointer;display:table;", " ", " span{display:table-cell;vertical-align:middle;text-align:center;font-weight:", ";}}"], _color.colorSupportive.heavy, _color.colorGrayscale.white, _mediaQuery["default"].tabletOnly(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: absolute;\n right: 110px;\n top: 9px;\n "]))), _mediaQuery["default"].mobileOnly(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n margin: 40px auto 0 auto;\n "]))), _font.fontWeight.bold);
|
|
109
|
-
|
|
110
83
|
var TextColumn = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
111
84
|
displayName: "podcast-box-section__TextColumn",
|
|
112
85
|
componentId: "sc-16lji0u-3"
|
|
113
86
|
})(["", ""], _mediaQuery["default"].desktopOnly(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n max-width: 608px;\n "]))));
|
|
114
|
-
|
|
115
87
|
var Icon = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
116
88
|
displayName: "podcast-box-section__Icon",
|
|
117
89
|
componentId: "sc-16lji0u-4"
|
|
118
90
|
})(["display:inline-block;margin-left:8.6px;width:7px;height:12px;"]);
|
|
119
|
-
|
|
120
91
|
var listenNow = /*#__PURE__*/_react["default"].createElement("span", null, "\u7ACB\u5373\u6536\u807D", /*#__PURE__*/_react["default"].createElement(Icon, null, /*#__PURE__*/_react["default"].createElement(ArrowIcon, null)));
|
|
121
|
-
|
|
122
92
|
var PodcastBoxSection = /*#__PURE__*/function (_React$PureComponent) {
|
|
123
93
|
_inherits(PodcastBoxSection, _React$PureComponent);
|
|
124
|
-
|
|
125
94
|
var _super = _createSuper(PodcastBoxSection);
|
|
126
|
-
|
|
127
95
|
function PodcastBoxSection() {
|
|
128
96
|
_classCallCheck(this, PodcastBoxSection);
|
|
129
|
-
|
|
130
97
|
return _super.apply(this, arguments);
|
|
131
98
|
}
|
|
132
|
-
|
|
133
99
|
_createClass(PodcastBoxSection, [{
|
|
134
100
|
key: "render",
|
|
135
101
|
value: function render() {
|
|
@@ -139,15 +105,12 @@ var PodcastBoxSection = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
139
105
|
}, /*#__PURE__*/_react["default"].createElement(ContentContainer, null, /*#__PURE__*/_react["default"].createElement(TextColumn, null, /*#__PURE__*/_react["default"].createElement("h3", null, "\u807DPodcast\uFF0C\u611F\u53D7\u771F\u5BE6"), /*#__PURE__*/_react["default"].createElement("p", null, "\u5831\u5C0E\u8005Podcast\u7BC0\u76EE\uFF0C\u900F\u904E\u8A18\u8005\u3001\u4E8B\u4EF6\u7576\u4E8B\u4EBA\u7684\u7B2C\u4E00\u624B\u544A\u767D\uFF0C\u548C\u4F86\u81EA\u73FE\u5834\u7684\u6536\u97F3\u7D00\u9304\uFF0C\u5E36\u4F60\u8D70\u9032\u65B0\u805E\u5E55\u5F8C\u3001\u6545\u4E8B\u73FE\u5834\uFF0C\u611F\u53D7\u66F4\u5B8C\u6574\u7684\u771F\u5BE6\u3002")), /*#__PURE__*/_react["default"].createElement(ListenButton, null, /*#__PURE__*/_react["default"].createElement(_podcastLink["default"], null, listenNow))));
|
|
140
106
|
}
|
|
141
107
|
}]);
|
|
142
|
-
|
|
143
108
|
return PodcastBoxSection;
|
|
144
109
|
}(_react["default"].PureComponent);
|
|
145
|
-
|
|
146
110
|
PodcastBoxSection.propTypes = {
|
|
147
111
|
releaseBranch: _releaseBranch.BRANCH_PROP_TYPES
|
|
148
112
|
};
|
|
149
113
|
PodcastBoxSection.defaultProps = {
|
|
150
114
|
releaseBranch: _releaseBranch.BRANCH.master
|
|
151
115
|
};
|
|
152
|
-
var _default = PodcastBoxSection;
|
|
153
|
-
exports["default"] = _default;
|
|
116
|
+
var _default = exports["default"] = PodcastBoxSection;
|
|
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
9
|
var target = _propTypes["default"].shape({
|
|
13
10
|
url: _propTypes["default"].string.isRequired,
|
|
14
11
|
height: _propTypes["default"].number,
|
|
15
12
|
width: _propTypes["default"].number
|
|
16
13
|
});
|
|
17
|
-
|
|
18
14
|
var image = _propTypes["default"].shape({
|
|
19
15
|
id: _propTypes["default"].string.isRequired,
|
|
20
16
|
description: _propTypes["default"].string,
|
|
@@ -25,6 +21,4 @@ var image = _propTypes["default"].shape({
|
|
|
25
21
|
tablet: target
|
|
26
22
|
}).isRequired
|
|
27
23
|
});
|
|
28
|
-
|
|
29
|
-
var _default = image;
|
|
30
|
-
exports["default"] = _default;
|
|
24
|
+
var _default = exports["default"] = image;
|
|
@@ -4,19 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
|
|
10
8
|
var _image = _interopRequireDefault(require("./image"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
|
-
function ownKeys(
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
10
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
11
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
20
16
|
var post = function post() {
|
|
21
17
|
var customPropTypes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
22
18
|
return _propTypes["default"].shape(_objectSpread({
|
|
@@ -33,6 +29,4 @@ var post = function post() {
|
|
|
33
29
|
}))
|
|
34
30
|
}, customPropTypes));
|
|
35
31
|
};
|
|
36
|
-
|
|
37
|
-
var _default = post;
|
|
38
|
-
exports["default"] = _default;
|
|
32
|
+
var _default = exports["default"] = post;
|
|
@@ -4,21 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
|
|
10
8
|
var _image = _interopRequireDefault(require("./image"));
|
|
11
|
-
|
|
12
9
|
var _post = _interopRequireDefault(require("./post"));
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
|
-
function ownKeys(
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
11
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
16
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
22
17
|
var topic = function topic() {
|
|
23
18
|
var customPropTypes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
24
19
|
return _propTypes["default"].shape(_objectSpread({
|
|
@@ -32,6 +27,4 @@ var topic = function topic() {
|
|
|
32
27
|
relateds: _propTypes["default"].arrayOf(_post["default"])
|
|
33
28
|
}, customPropTypes));
|
|
34
29
|
};
|
|
35
|
-
|
|
36
|
-
var _default = topic;
|
|
37
|
-
exports["default"] = _default;
|
|
30
|
+
var _default = exports["default"] = topic;
|
|
@@ -1,76 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _post = _interopRequireDefault(require("./prop-types/post"));
|
|
15
|
-
|
|
16
11
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
17
|
-
|
|
18
12
|
var _getHref = require("../utils/getHref");
|
|
19
|
-
|
|
20
13
|
var _styleUtils = require("../utils/style-utils");
|
|
21
|
-
|
|
22
14
|
var _bottomLink = _interopRequireDefault(require("./common-utils/bottom-link"));
|
|
23
|
-
|
|
24
15
|
var _categoryName = _interopRequireDefault(require("./common-utils/category-name"));
|
|
25
|
-
|
|
26
16
|
var _imgWrapper = _interopRequireDefault(require("./common-utils/img-wrapper"));
|
|
27
|
-
|
|
28
17
|
var _sectionAnimationWrapper = _interopRequireDefault(require("./animations/section-animation-wrapper"));
|
|
29
|
-
|
|
30
18
|
var _sectionName = _interopRequireDefault(require("./common-utils/section-name"));
|
|
31
|
-
|
|
32
19
|
var _section = _interopRequireDefault(require("./common-utils/section"));
|
|
33
|
-
|
|
34
20
|
var _twreporterLink = _interopRequireDefault(require("./common-utils/twreporter-link"));
|
|
35
|
-
|
|
36
21
|
var _mobileSwiperList = _interopRequireDefault(require("./mobile-swiper-list"));
|
|
37
|
-
|
|
38
22
|
var _sectionStrings = _interopRequireDefault(require("../constants/section-strings"));
|
|
39
|
-
|
|
40
23
|
var _font = require("@twreporter/core/lib/constants/font");
|
|
41
|
-
|
|
42
24
|
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
43
|
-
|
|
44
25
|
var _color = require("@twreporter/core/lib/constants/color");
|
|
45
|
-
|
|
46
26
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
27
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13; // utils
|
|
28
|
+
// components
|
|
29
|
+
// constants
|
|
30
|
+
// @twreporter
|
|
31
|
+
// lodash
|
|
50
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
51
|
-
|
|
52
33
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
53
|
-
|
|
54
|
-
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); } }
|
|
55
|
-
|
|
34
|
+
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
56
35
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
57
|
-
|
|
36
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
37
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
58
38
|
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
59
|
-
|
|
60
39
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
61
|
-
|
|
62
40
|
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); }; }
|
|
63
|
-
|
|
64
41
|
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); }
|
|
65
|
-
|
|
66
42
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
67
|
-
|
|
68
43
|
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; } }
|
|
69
|
-
|
|
70
44
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
71
|
-
|
|
72
45
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
73
|
-
|
|
74
46
|
var _ = {
|
|
75
47
|
get: _get["default"]
|
|
76
48
|
};
|
|
@@ -90,72 +62,56 @@ var Container = /*#__PURE__*/(0, _styledComponents["default"])(_section["default
|
|
|
90
62
|
displayName: "reviews__Container",
|
|
91
63
|
componentId: "wgotxd-0"
|
|
92
64
|
})(["background-color:", ";", ""], _color.colorGrayscale.white, _mediaQuery["default"].tabletAndBelow(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-top: 36px;\n "]))));
|
|
93
|
-
|
|
94
65
|
var FlexBox = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
95
66
|
displayName: "reviews__FlexBox",
|
|
96
67
|
componentId: "wgotxd-1"
|
|
97
68
|
})(["display:flex;padding:0 47px;justify-content:center;", " ", ""], _mediaQuery["default"].tabletOnly(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 0 35px;\n "]))), _mediaQuery["default"].mobileOnly(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: none;\n "]))));
|
|
98
|
-
|
|
99
69
|
var FlexItem = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
100
70
|
displayName: "reviews__FlexItem",
|
|
101
71
|
componentId: "wgotxd-2"
|
|
102
72
|
})(["width:312px;&:nth-child(3){margin-left:32.6px;}&:nth-child(even){margin-left:32.6px;}", " ", " ", ""], _mediaQuery["default"].desktopOnly(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 210px;\n &:nth-child(3) {\n margin-left: 30px;\n }\n &:nth-child(even) {\n margin-left: 30px;\n }\n "]))), _mediaQuery["default"].tabletOnly(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n width: 160px;\n &:nth-child(3) {\n margin-left: 20px;\n }\n &:nth-child(even) {\n margin-left: 20px;\n }\n "]))), _mediaQuery["default"].mobileOnly(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-top: 10px;\n width: 100%;\n "]))));
|
|
103
|
-
|
|
104
73
|
var ImgFrame = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
105
74
|
displayName: "reviews__ImgFrame",
|
|
106
75
|
componentId: "wgotxd-3"
|
|
107
76
|
})(["width:100%;height:202px;", " ", " ", ""], _mediaQuery["default"].desktopOnly(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n height: 138px;\n "]))), _mediaQuery["default"].tabletOnly(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n height: 102px;\n "]))), _mediaQuery["default"].mobileOnly(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n height: 186px;\n "]))));
|
|
108
|
-
|
|
109
77
|
var TextFrame = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
110
78
|
displayName: "reviews__TextFrame",
|
|
111
79
|
componentId: "wgotxd-4"
|
|
112
80
|
})(["margin:12px auto 0 auto;width:92%;"]);
|
|
113
|
-
|
|
114
81
|
var Category = /*#__PURE__*/(0, _styledComponents["default"])(_categoryName["default"]).withConfig({
|
|
115
82
|
displayName: "reviews__Category",
|
|
116
83
|
componentId: "wgotxd-5"
|
|
117
84
|
})(["line-height:1.33;", ""], _mediaQuery["default"].mobileOnly(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n margin-top: 9px;\n "]))));
|
|
118
|
-
|
|
119
85
|
var Title = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
120
86
|
displayName: "reviews__Title",
|
|
121
87
|
componentId: "wgotxd-6"
|
|
122
88
|
})(["margin-top:2px;font-size:20px;font-weight:", ";font-family:", ";line-height:1.5;", " color:", ";"], _font.fontWeight.bold, _font.fontFamily.title, _mediaQuery["default"].tabletOnly(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n width: 144px;\n "]))), _color.colorGrayscale.gray800);
|
|
123
|
-
|
|
124
89
|
var Description = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
125
90
|
displayName: "reviews__Description",
|
|
126
91
|
componentId: "wgotxd-7"
|
|
127
92
|
})(["margin-top:8px;font-size:16px;color:", ";", " ", " ", ""], _color.colorGrayscale.gray800, _mediaQuery["default"].tabletOnly(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n width: 144px;\n "]))), _mediaQuery["default"].mobileOnly(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n font-size: 18px;\n "]))), (0, _styleUtils.truncate)('relative', 1.5, 5, _color.colorGrayscale.white));
|
|
128
|
-
|
|
129
93
|
var More = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
130
94
|
displayName: "reviews__More",
|
|
131
95
|
componentId: "wgotxd-8"
|
|
132
96
|
})(["text-align:center;margin-top:60px;"]);
|
|
133
|
-
|
|
134
97
|
var Reviews = /*#__PURE__*/function (_React$PureComponent) {
|
|
135
98
|
_inherits(Reviews, _React$PureComponent);
|
|
136
|
-
|
|
137
99
|
var _super = _createSuper(Reviews);
|
|
138
|
-
|
|
139
100
|
function Reviews() {
|
|
140
101
|
_classCallCheck(this, Reviews);
|
|
141
|
-
|
|
142
102
|
return _super.apply(this, arguments);
|
|
143
103
|
}
|
|
144
|
-
|
|
145
104
|
_createClass(Reviews, [{
|
|
146
105
|
key: "render",
|
|
147
106
|
value: function render() {
|
|
148
107
|
var _this$props = this.props,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
108
|
+
data = _this$props.data,
|
|
109
|
+
moreURI = _this$props.moreURI,
|
|
110
|
+
useTinyImg = _this$props.useTinyImg;
|
|
152
111
|
var ReviewsItem = data.map(function (post) {
|
|
153
112
|
var isExternal = _.get(post, 'is_external', false);
|
|
154
|
-
|
|
155
113
|
var href = (0, _getHref.getHref)(_.get(post, 'slug', 'error'), isExternal);
|
|
156
|
-
|
|
157
114
|
var imgObj = _.get(post, 'hero_image') || _.get(post, 'og_image');
|
|
158
|
-
|
|
159
115
|
return /*#__PURE__*/_react["default"].createElement(FlexItem, {
|
|
160
116
|
key: _.get(post, 'id')
|
|
161
117
|
}, /*#__PURE__*/_react["default"].createElement(_twreporterLink["default"], {
|
|
@@ -174,10 +130,8 @@ var Reviews = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
174
130
|
})));
|
|
175
131
|
}
|
|
176
132
|
}]);
|
|
177
|
-
|
|
178
133
|
return Reviews;
|
|
179
134
|
}(_react["default"].PureComponent);
|
|
180
|
-
|
|
181
135
|
Reviews.defaultProps = {
|
|
182
136
|
data: [],
|
|
183
137
|
moreURI: 'categories/reviews',
|
|
@@ -188,7 +142,4 @@ Reviews.propTypes = {
|
|
|
188
142
|
moreURI: _propTypes["default"].string,
|
|
189
143
|
useTinyImg: _propTypes["default"].bool
|
|
190
144
|
};
|
|
191
|
-
|
|
192
|
-
var _default = (0, _sectionAnimationWrapper["default"])(Reviews);
|
|
193
|
-
|
|
194
|
-
exports["default"] = _default;
|
|
145
|
+
var _default = exports["default"] = (0, _sectionAnimationWrapper["default"])(Reviews);
|