@twreporter/react-components 9.0.2 → 9.1.0-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 +22 -0
- package/lib/badge/badge.stories.js +3 -9
- package/lib/badge/index.js +8 -24
- package/lib/bookmark-list/bookmark.js +20 -69
- package/lib/bookmark-list/bookmarks.js +10 -40
- package/lib/bookmark-list/customized-link.js +4 -14
- package/lib/bookmark-list/image-wrapper.js +9 -36
- package/lib/bookmark-list/index.js +36 -91
- package/lib/bookmark-list/redirect-to-sign-in.js +1 -10
- package/lib/bookmark-list/stories/bookmark.stories.js +3 -9
- package/lib/bookmark-widget/index.js +91 -220
- package/lib/button/components/iconButton.js +15 -34
- package/lib/button/components/iconWithTextButton.js +16 -31
- package/lib/button/components/link.js +27 -45
- package/lib/button/components/menuButton.js +18 -38
- package/lib/button/components/pillButton.js +31 -60
- package/lib/button/components/textButton.js +29 -61
- package/lib/button/components/toggleButton.js +11 -31
- package/lib/button/enums/index.js +4 -7
- package/lib/button/index.js +5 -18
- package/lib/button/stories/iconButton.stories.js +4 -15
- package/lib/button/stories/iconWithTextButton.stories.js +4 -13
- package/lib/button/stories/link.stories.js +9 -27
- package/lib/button/stories/menuButton.stories.js +3 -10
- package/lib/button/stories/pillButton.stories.js +4 -15
- package/lib/button/stories/textButton.stories.js +4 -15
- package/lib/button/stories/toggleButton.stories.js +3 -8
- package/lib/button/utils/size.js +3 -8
- package/lib/button/utils/theme.js +11 -102
- package/lib/card/components/article-card.js +31 -59
- package/lib/card/components/dialog.js +7 -22
- package/lib/card/components/short-story.js +24 -44
- package/lib/card/index.js +2 -8
- package/lib/card/stories/articleCard.stories.js +3 -14
- package/lib/card/stories/dialog.stories.js +3 -11
- package/lib/card/stories/shortStory.stories.js +3 -16
- package/lib/checkbox/checkbox.stories.js +3 -8
- package/lib/checkbox/index.js +10 -31
- package/lib/color.stories.js +9 -34
- package/lib/confirmation/index.js +7 -29
- package/lib/customized-link.js +5 -18
- package/lib/divider.js +3 -19
- package/lib/divider.stories.js +5 -18
- package/lib/donation-link.js +2 -14
- package/lib/empty-state/enums/index.js +2 -3
- package/lib/empty-state/index.js +20 -41
- package/lib/empty-state/stories/empty-guide.stories.js +3 -11
- package/lib/error/index.js +3 -8
- package/lib/error/message.js +3 -44
- package/lib/footer/constants/links.js +10 -16
- package/lib/footer/footer.stories.js +3 -10
- package/lib/footer/index.js +5 -40
- package/lib/footer/link.js +15 -46
- package/lib/footer/logo.js +12 -32
- package/lib/hook/index.js +3 -18
- package/lib/hook/use-bookmark.js +21 -47
- package/lib/hook/use-font-face-observer.js +9 -24
- package/lib/hook/use-outside-click.js +4 -9
- package/lib/icon/enum/index.js +5 -9
- package/lib/icon/index.js +49 -105
- package/lib/icon/stories/arrow.stories.js +7 -16
- package/lib/icon/stories/article.stories.js +2 -7
- package/lib/icon/stories/bookmark.stories.js +6 -14
- package/lib/icon/stories/changeIconColor.stories.js +2 -12
- package/lib/icon/stories/clock.stories.js +2 -7
- package/lib/icon/stories/copy.stories.js +2 -7
- package/lib/icon/stories/cross.stories.js +2 -7
- package/lib/icon/stories/hamburger.stories.js +2 -7
- package/lib/icon/stories/home.stories.js +2 -7
- package/lib/icon/stories/letter.stories.js +2 -7
- package/lib/icon/stories/loading.stories.js +2 -7
- package/lib/icon/stories/member.stories.js +2 -7
- package/lib/icon/stories/printer.stories.js +2 -7
- package/lib/icon/stories/search.stories.js +2 -7
- package/lib/icon/stories/share.stories.js +2 -7
- package/lib/icon/stories/socialMedia.stories.js +2 -8
- package/lib/icon/stories/text.stories.js +2 -7
- package/lib/icon/stories/topic.stories.js +2 -7
- package/lib/image-with-fallback.js +22 -52
- package/lib/input/components/search-bar.js +40 -85
- package/lib/input/components/text-field.js +20 -40
- package/lib/input/enums/index.js +6 -8
- package/lib/input/index.js +2 -7
- package/lib/input/stories/search-bar.stories.js +3 -16
- package/lib/input/stories/text-field.stories.js +3 -14
- package/lib/input/utils/theme.js +2 -9
- package/lib/is-fetching-wrapper.js +16 -48
- package/lib/junior-link.js +6 -29
- package/lib/link-with-tracker.js +14 -47
- package/lib/listing-page/components/card-list.js +20 -51
- package/lib/listing-page/components/image.js +15 -46
- package/lib/listing-page/components/list-item.js +18 -65
- package/lib/listing-page/components/list.js +17 -61
- package/lib/listing-page/components/page-content.js +2 -12
- package/lib/listing-page/components/topics/index.js +26 -74
- package/lib/listing-page/components/topics/post-item.js +14 -47
- package/lib/listing-page/components/topics/posts.js +1 -10
- package/lib/listing-page/components/topics/section.js +3 -25
- package/lib/listing-page/components/topics/topic-item.js +17 -56
- package/lib/listing-page/constants/mockup-spec.js +2 -3
- package/lib/listing-page/constants/predefined-css.js +2 -10
- package/lib/listing-page/constants/prop-types.js +2 -7
- package/lib/listing-page/constants/topics.js +2 -3
- package/lib/listing-page/index.js +2 -8
- package/lib/listing-page/stories/cardList.stories.js +3 -10
- package/lib/logo/components/logo-footer.js +6 -21
- package/lib/logo/components/logo-header.js +7 -23
- package/lib/logo/components/logo-loading-fallback.js +4 -13
- package/lib/logo/components/logo-symbol.js +7 -23
- package/lib/logo/index.js +2 -9
- package/lib/logo/stories/logoFooter.stories.js +2 -8
- package/lib/logo/stories/logoHeader.stories.js +3 -9
- package/lib/logo/stories/logoLoadingFallback.stories.js +2 -8
- package/lib/logo/stories/logoSymbol.stories.js +3 -9
- package/lib/logo/utils/path.js +2 -9
- package/lib/material-icon.js +9 -17
- package/lib/mobile-member-role-card/index.js +22 -49
- package/lib/mobile-member-role-card/stories/member-role-card.stories.js +3 -12
- package/lib/mobile-pop-up-modal.js +10 -44
- package/lib/more.js +10 -37
- package/lib/pagination/index.js +17 -83
- package/lib/podcast-link.js +6 -29
- package/lib/rwd.js +6 -26
- package/lib/shared-enum.js +2 -3
- package/lib/side-bar/index.js +16 -59
- package/lib/simple-header/index.js +2 -12
- package/lib/simple-header/simpleHeader.stories.js +3 -8
- package/lib/snack-bar/components/snack-bar.js +9 -20
- package/lib/snack-bar/hooks/use-snack-bar.js +12 -25
- package/lib/snack-bar/index.js +2 -7
- package/lib/snack-bar/stories/snackBar.stories.js +12 -29
- package/lib/snack-bar/utils/theme.js +3 -9
- package/lib/storybook/constants/index.js +3 -11
- package/lib/storybook/utils/get-enum-arg.js +2 -5
- package/lib/table-of-contents/index.js +62 -128
- package/lib/text/constants/headline-type.js +5 -8
- package/lib/text/enums/index.js +3 -5
- package/lib/text/headline.js +14 -41
- package/lib/text/paragraph.js +13 -34
- package/lib/text/stories/headline.stories.js +8 -21
- package/lib/text/stories/paragraph.stories.js +6 -17
- package/lib/text/utils/webfonts.js +9 -22
- package/lib/title-bar/components/tab.js +27 -69
- package/lib/title-bar/components/title1.js +6 -17
- package/lib/title-bar/components/title2.js +7 -23
- package/lib/title-bar/index.js +2 -8
- package/lib/title-bar/stories/tab.stories.js +5 -12
- package/lib/title-bar/stories/title1.stories.js +5 -12
- package/lib/title-bar/stories/title2.stories.js +3 -11
- package/lib/utils/link-with-params.js +0 -5
- package/package.json +4 -4
- package/lib/hook/use-store.js +0 -46
|
@@ -1,116 +1,78 @@
|
|
|
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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
11
|
var _entityPath = _interopRequireDefault(require("@twreporter/core/lib/constants/entity-path"));
|
|
17
|
-
|
|
18
12
|
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
19
|
-
|
|
20
13
|
var _date = require("@twreporter/core/lib/utils/date");
|
|
21
|
-
|
|
22
14
|
var _theme = require("@twreporter/core/lib/constants/theme");
|
|
23
|
-
|
|
24
15
|
var _mockupSpec = _interopRequireDefault(require("../constants/mockup-spec"));
|
|
25
|
-
|
|
26
16
|
var _listItem = _interopRequireDefault(require("./list-item"));
|
|
27
|
-
|
|
28
17
|
var _pageContent = _interopRequireDefault(require("./page-content"));
|
|
29
|
-
|
|
30
18
|
var _titleBar = require("../../title-bar");
|
|
31
|
-
|
|
32
19
|
var _isFetchingWrapper = _interopRequireDefault(require("../../is-fetching-wrapper"));
|
|
33
|
-
|
|
34
20
|
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
35
|
-
|
|
36
21
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
37
|
-
|
|
38
22
|
var _map = _interopRequireDefault(require("lodash/map"));
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
function _interopRequireWildcard(
|
|
45
|
-
|
|
23
|
+
var _templateObject, _templateObject2, _templateObject3; // @twreporter
|
|
24
|
+
// constants
|
|
25
|
+
// components
|
|
26
|
+
// lodash
|
|
27
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
28
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
46
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
47
|
-
|
|
48
30
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
49
|
-
|
|
50
|
-
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); } }
|
|
51
|
-
|
|
31
|
+
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); } }
|
|
52
32
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
53
|
-
|
|
33
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
34
|
+
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); }
|
|
54
35
|
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); }
|
|
55
|
-
|
|
56
36
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
57
|
-
|
|
58
37
|
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); }; }
|
|
59
|
-
|
|
60
38
|
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); }
|
|
61
|
-
|
|
62
39
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
63
|
-
|
|
64
40
|
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; } }
|
|
65
|
-
|
|
66
41
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
67
|
-
|
|
68
42
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
69
|
-
|
|
70
43
|
var _ = {
|
|
71
44
|
forEach: _forEach["default"],
|
|
72
45
|
get: _get["default"],
|
|
73
46
|
map: _map["default"]
|
|
74
47
|
};
|
|
75
|
-
|
|
76
48
|
var FlexItems = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
77
49
|
displayName: "list__FlexItems",
|
|
78
50
|
componentId: "sc-1olquk4-0"
|
|
79
51
|
})(["width:", "px;margin:64px auto 0;display:flex;justify-content:flex-start;align-items:flex-start;flex-wrap:wrap;> div:nth-child(odd){margin-right:", "px;}", " ", " ", ""], _mockupSpec["default"].hd.maxWidth, _mockupSpec["default"].marginBetweenItems, _mediaQuery["default"].desktopOnly(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", "px;\n "])), _mockupSpec["default"].desktop.maxWidth), _mediaQuery["default"].tabletOnly(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: ", "px;\n margin-top: 32px;\n "])), _mockupSpec["default"].tablet.maxWidth), _mediaQuery["default"].mobileOnly(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n margin-top: 24px;\n > div:nth-child(odd) {\n margin-right: 0;\n }\n justify-content: center;\n "]))));
|
|
80
|
-
|
|
81
52
|
var Items = (0, _isFetchingWrapper["default"])(FlexItems);
|
|
82
|
-
|
|
83
53
|
var List = /*#__PURE__*/function (_PureComponent) {
|
|
84
54
|
_inherits(List, _PureComponent);
|
|
85
|
-
|
|
86
55
|
var _super = _createSuper(List);
|
|
87
|
-
|
|
88
56
|
function List() {
|
|
89
57
|
_classCallCheck(this, List);
|
|
90
|
-
|
|
91
58
|
return _super.apply(this, arguments);
|
|
92
59
|
}
|
|
93
|
-
|
|
94
60
|
_createClass(List, [{
|
|
95
61
|
key: "render",
|
|
96
62
|
value: function render() {
|
|
97
63
|
var _this$props = this.props,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
64
|
+
data = _this$props.data,
|
|
65
|
+
catName = _this$props.catName,
|
|
66
|
+
tagName = _this$props.tagName,
|
|
67
|
+
isFetching = _this$props.isFetching,
|
|
68
|
+
showSpinner = _this$props.showSpinner,
|
|
69
|
+
showCategory = _this$props.showCategory;
|
|
104
70
|
var listJSX = [];
|
|
105
|
-
|
|
106
71
|
_.forEach(data, function (item) {
|
|
107
72
|
var style = _.get(item, 'style');
|
|
108
|
-
|
|
109
73
|
var slug = _.get(item, 'slug');
|
|
110
|
-
|
|
111
74
|
var isInteractiveArticle = style === _theme.ARTICLE_THEME.v2.interactive;
|
|
112
75
|
var to = "".concat(isInteractiveArticle ? _entityPath["default"].interactiveArticle : _entityPath["default"].article).concat(slug);
|
|
113
|
-
|
|
114
76
|
var tags = _.map(_.get(item, 'tags'), function (tag) {
|
|
115
77
|
if (_.get(tag, 'name') === tagName) {
|
|
116
78
|
return {
|
|
@@ -119,13 +81,11 @@ var List = /*#__PURE__*/function (_PureComponent) {
|
|
|
119
81
|
selected: true
|
|
120
82
|
};
|
|
121
83
|
}
|
|
122
|
-
|
|
123
84
|
return {
|
|
124
85
|
id: _.get(tag, 'id'),
|
|
125
86
|
name: _.get(tag, 'name', '')
|
|
126
87
|
};
|
|
127
88
|
});
|
|
128
|
-
|
|
129
89
|
listJSX.push( /*#__PURE__*/_react["default"].createElement(_listItem["default"], {
|
|
130
90
|
key: _.get(item, 'id'),
|
|
131
91
|
title: _.get(item, 'title', ''),
|
|
@@ -145,7 +105,6 @@ var List = /*#__PURE__*/function (_PureComponent) {
|
|
|
145
105
|
}
|
|
146
106
|
}));
|
|
147
107
|
});
|
|
148
|
-
|
|
149
108
|
var headerTitle = catName || (tagName ? "#".concat(tagName) : '');
|
|
150
109
|
var headerJSX = headerTitle ? /*#__PURE__*/_react["default"].createElement(_titleBar.Title1, {
|
|
151
110
|
title: headerTitle !== null && headerTitle !== void 0 ? headerTitle : ''
|
|
@@ -156,10 +115,8 @@ var List = /*#__PURE__*/function (_PureComponent) {
|
|
|
156
115
|
}, listJSX));
|
|
157
116
|
}
|
|
158
117
|
}]);
|
|
159
|
-
|
|
160
118
|
return List;
|
|
161
119
|
}(_react.PureComponent);
|
|
162
|
-
|
|
163
120
|
List.defaultProps = {
|
|
164
121
|
data: [],
|
|
165
122
|
catName: '',
|
|
@@ -185,5 +142,4 @@ List.propTypes = {
|
|
|
185
142
|
showSpinner: _propTypes["default"].bool,
|
|
186
143
|
showCategory: _propTypes["default"].bool
|
|
187
144
|
};
|
|
188
|
-
var _default = List;
|
|
189
|
-
exports["default"] = _default;
|
|
145
|
+
var _default = exports["default"] = List;
|
|
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
-
|
|
10
8
|
var _predefinedCss = require("../constants/predefined-css");
|
|
11
|
-
|
|
12
9
|
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
13
|
-
|
|
14
10
|
var _templateObject, _templateObject2, _templateObject3;
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
|
-
|
|
20
13
|
var styles = {
|
|
21
14
|
contentWidth: {
|
|
22
15
|
min: 300,
|
|
@@ -28,19 +21,16 @@ var styles = {
|
|
|
28
21
|
desktop: 922,
|
|
29
22
|
// px
|
|
30
23
|
hd: 1130 // px
|
|
31
|
-
|
|
32
24
|
},
|
|
25
|
+
|
|
33
26
|
titlePadding: 0,
|
|
34
27
|
titleMargin: {
|
|
35
28
|
mobile: [0, 0, 19, 0],
|
|
36
29
|
tablet: [0, 0, 33, 0]
|
|
37
30
|
}
|
|
38
31
|
};
|
|
39
|
-
|
|
40
32
|
var PageContent = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
41
33
|
displayName: "page-content__PageContent",
|
|
42
34
|
componentId: "sc-10tix5l-0"
|
|
43
35
|
})(["min-width:", "px;width:", "%;", " ", " ", " margin:0 auto;", ""], styles.contentWidth.min, styles.contentWidth.mobile, _mediaQuery["default"].tabletOnly(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", "px;\n "])), styles.contentWidth.tablet), _mediaQuery["default"].desktopOnly(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: ", "px;\n "])), styles.contentWidth.desktop), _mediaQuery["default"].hdOnly(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: ", "px;\n "])), styles.contentWidth.hd), _predefinedCss.resetLinkStyle);
|
|
44
|
-
|
|
45
|
-
var _default = PageContent;
|
|
46
|
-
exports["default"] = _default;
|
|
36
|
+
var _default = exports["default"] = PageContent;
|
|
@@ -4,98 +4,64 @@ 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 _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
|
|
14
10
|
var _isFetchingWrapper = _interopRequireDefault(require("../../../is-fetching-wrapper"));
|
|
15
|
-
|
|
16
11
|
var _posts = _interopRequireDefault(require("./posts"));
|
|
17
|
-
|
|
18
12
|
var _postItem = _interopRequireDefault(require("./post-item"));
|
|
19
|
-
|
|
20
13
|
var _topicItem = _interopRequireDefault(require("./topic-item"));
|
|
21
|
-
|
|
22
14
|
var _pageContent = _interopRequireDefault(require("../page-content"));
|
|
23
|
-
|
|
24
15
|
var _section = require("./section");
|
|
25
|
-
|
|
26
16
|
var _topics = require("../../constants/topics");
|
|
27
|
-
|
|
28
17
|
var _font = require("@twreporter/core/lib/constants/font");
|
|
29
|
-
|
|
30
18
|
var _titleBar = require("@twreporter/react-components/lib/title-bar");
|
|
31
|
-
|
|
32
19
|
var _headline = require("@twreporter/react-components/lib/text/headline");
|
|
33
|
-
|
|
34
20
|
var _color = require("@twreporter/core/lib/constants/color");
|
|
35
|
-
|
|
36
21
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
37
|
-
|
|
38
22
|
var _map = _interopRequireDefault(require("lodash/map"));
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
43
|
-
|
|
23
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
24
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
44
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
45
|
-
|
|
46
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
47
|
-
|
|
26
|
+
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); }
|
|
48
27
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
49
|
-
|
|
50
|
-
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); } }
|
|
51
|
-
|
|
28
|
+
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); } }
|
|
52
29
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
53
|
-
|
|
30
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
31
|
+
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); }
|
|
54
32
|
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); }
|
|
55
|
-
|
|
56
33
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
57
|
-
|
|
58
34
|
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); }; }
|
|
59
|
-
|
|
60
35
|
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); }
|
|
61
|
-
|
|
62
36
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
63
|
-
|
|
64
37
|
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; } }
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
38
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } // components
|
|
39
|
+
// constants
|
|
40
|
+
// @twreporter
|
|
41
|
+
// lodash
|
|
68
42
|
var _ = {
|
|
69
43
|
get: _get["default"],
|
|
70
44
|
map: _map["default"]
|
|
71
45
|
};
|
|
72
|
-
|
|
73
46
|
var NoData = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
74
47
|
displayName: "topics__NoData",
|
|
75
48
|
componentId: "sc-1n6udj1-0"
|
|
76
49
|
})(["width:100%;font-size:16px;color:", ";font-weight:", ";text-align:center;"], _color.colorGrayscale.gray900, _font.fontWeight.normal);
|
|
77
|
-
|
|
78
50
|
var Title2Wrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
79
51
|
displayName: "topics__Title2Wrapper",
|
|
80
52
|
componentId: "sc-1n6udj1-1"
|
|
81
53
|
})(["padding-top:24px;"]);
|
|
82
|
-
|
|
83
54
|
var Gray800H2 = /*#__PURE__*/(0, _styledComponents["default"])(_headline.H2).withConfig({
|
|
84
55
|
displayName: "topics__Gray800H2",
|
|
85
56
|
componentId: "sc-1n6udj1-2"
|
|
86
57
|
})(["color:", ";"], _color.colorGrayscale.gray800);
|
|
87
|
-
|
|
88
58
|
var Topics = /*#__PURE__*/function (_Component) {
|
|
89
59
|
_inherits(Topics, _Component);
|
|
90
|
-
|
|
91
60
|
var _super = _createSuper(Topics);
|
|
92
|
-
|
|
93
61
|
function Topics() {
|
|
94
62
|
_classCallCheck(this, Topics);
|
|
95
|
-
|
|
96
63
|
return _super.apply(this, arguments);
|
|
97
64
|
}
|
|
98
|
-
|
|
99
65
|
_createClass(Topics, [{
|
|
100
66
|
key: "_buildRelatedPosts",
|
|
101
67
|
value: function _buildRelatedPosts(posts) {
|
|
@@ -103,12 +69,11 @@ var Topics = /*#__PURE__*/function (_Component) {
|
|
|
103
69
|
if (_typeof(post) !== 'object' || post === null) {
|
|
104
70
|
return null;
|
|
105
71
|
}
|
|
106
|
-
|
|
107
72
|
var id = post.id,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
73
|
+
linkTarget = post.linkTarget,
|
|
74
|
+
linkTo = post.linkTo,
|
|
75
|
+
title = post.title,
|
|
76
|
+
imgUrl = post.imgUrl;
|
|
112
77
|
return /*#__PURE__*/_react["default"].createElement(_postItem["default"], {
|
|
113
78
|
key: "post-".concat(id),
|
|
114
79
|
title: title,
|
|
@@ -117,7 +82,6 @@ var Topics = /*#__PURE__*/function (_Component) {
|
|
|
117
82
|
linkTarget: linkTarget
|
|
118
83
|
});
|
|
119
84
|
};
|
|
120
|
-
|
|
121
85
|
return _.map(posts, _buildPostJSX);
|
|
122
86
|
}
|
|
123
87
|
}, {
|
|
@@ -125,12 +89,12 @@ var Topics = /*#__PURE__*/function (_Component) {
|
|
|
125
89
|
value: function _buildTopicBoxes(topics) {
|
|
126
90
|
var _buildTopicBox = function _buildTopicBox(item, index) {
|
|
127
91
|
var id = item.id,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
92
|
+
linkTo = item.linkTo,
|
|
93
|
+
title = item.title,
|
|
94
|
+
updatedAt = item.updatedAt,
|
|
95
|
+
description = item.description,
|
|
96
|
+
imgUrl = item.imgUrl,
|
|
97
|
+
imgAlt = item.imgAlt;
|
|
134
98
|
return /*#__PURE__*/_react["default"].createElement(_topicItem["default"], {
|
|
135
99
|
key: "topic-".concat(id),
|
|
136
100
|
title: title,
|
|
@@ -142,40 +106,32 @@ var Topics = /*#__PURE__*/function (_Component) {
|
|
|
142
106
|
linkTo: linkTo
|
|
143
107
|
});
|
|
144
108
|
};
|
|
145
|
-
|
|
146
109
|
return _.map(topics, _buildTopicBox);
|
|
147
110
|
}
|
|
148
111
|
}, {
|
|
149
112
|
key: "render",
|
|
150
113
|
value: function render() {
|
|
151
114
|
var _this$props = this.props,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
115
|
+
topics = _this$props.topics,
|
|
116
|
+
currentPage = _this$props.currentPage,
|
|
117
|
+
isFetching = _this$props.isFetching,
|
|
118
|
+
showSpinner = _this$props.showSpinner;
|
|
157
119
|
if (!isFetching && _.get(topics, 'length', 0) <= 0) {
|
|
158
120
|
return /*#__PURE__*/_react["default"].createElement(_pageContent["default"], null, /*#__PURE__*/_react["default"].createElement(NoData, null, "\u7121\u8CC7\u6599"));
|
|
159
121
|
}
|
|
160
|
-
|
|
161
122
|
var isFirstPage = currentPage === 1;
|
|
162
123
|
/* Build PageContent */
|
|
163
|
-
|
|
164
124
|
var topicsJSX = this._buildTopicBoxes(topics);
|
|
165
|
-
|
|
166
125
|
var topTopicJSX = null;
|
|
167
126
|
var listedTopicsJSX = null;
|
|
168
127
|
var topRelatedPosts = null;
|
|
169
128
|
var topTopicName = null;
|
|
170
129
|
var topicUrl = null;
|
|
171
130
|
var topSectionJSX = null;
|
|
172
|
-
|
|
173
131
|
if (isFirstPage && !isFetching) {
|
|
174
132
|
topTopicJSX = topicsJSX[0];
|
|
175
133
|
listedTopicsJSX = topicsJSX.slice(1);
|
|
176
|
-
topRelatedPosts = _.get(topics, [0, 'relateds'], []).slice(-3);
|
|
177
|
-
/* take last 3 posts from the end */
|
|
178
|
-
|
|
134
|
+
topRelatedPosts = _.get(topics, [0, 'relateds'], []).slice(-3); /* take last 3 posts from the end */
|
|
179
135
|
topTopicName = _.get(topics, [0, 'topic_name'], '');
|
|
180
136
|
topicUrl = _.get(topics, [0, 'linkTo'], '');
|
|
181
137
|
topSectionJSX = [/*#__PURE__*/_react["default"].createElement(Gray800H2, {
|
|
@@ -193,7 +149,6 @@ var Topics = /*#__PURE__*/function (_Component) {
|
|
|
193
149
|
} else {
|
|
194
150
|
listedTopicsJSX = topicsJSX;
|
|
195
151
|
}
|
|
196
|
-
|
|
197
152
|
var WrappedListSectionContent = (0, _isFetchingWrapper["default"])( /*#__PURE__*/_react["default"].createElement(_section.ListSectionContent, null, listedTopicsJSX));
|
|
198
153
|
return /*#__PURE__*/_react["default"].createElement(_pageContent["default"], null, topSectionJSX, isFetching && isFirstPage ? null : /*#__PURE__*/_react["default"].createElement(Title2Wrapper, null, /*#__PURE__*/_react["default"].createElement(_titleBar.Title2, {
|
|
199
154
|
title: _topics.TEXT.SECTION_TITLE_OTHERS
|
|
@@ -203,10 +158,8 @@ var Topics = /*#__PURE__*/function (_Component) {
|
|
|
203
158
|
}));
|
|
204
159
|
}
|
|
205
160
|
}]);
|
|
206
|
-
|
|
207
161
|
return Topics;
|
|
208
162
|
}(_react.Component);
|
|
209
|
-
|
|
210
163
|
Topics.propTypes = {
|
|
211
164
|
topics: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
212
165
|
id: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]).isRequired,
|
|
@@ -234,5 +187,4 @@ Topics.defaultProps = {
|
|
|
234
187
|
currentPage: 1,
|
|
235
188
|
showSpinner: false
|
|
236
189
|
};
|
|
237
|
-
var _default = Topics;
|
|
238
|
-
exports["default"] = _default;
|
|
190
|
+
var _default = exports["default"] = Topics;
|
|
@@ -1,62 +1,39 @@
|
|
|
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 _reactRouterDom = require("react-router-dom");
|
|
11
|
-
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
11
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
17
|
-
|
|
18
12
|
var _image = _interopRequireDefault(require("../image"));
|
|
19
|
-
|
|
20
13
|
var _predefinedCss = require("../../constants/predefined-css");
|
|
21
|
-
|
|
22
14
|
var _css = require("@twreporter/core/lib/utils/css");
|
|
23
|
-
|
|
24
15
|
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
25
|
-
|
|
26
16
|
var _font = require("@twreporter/core/lib/constants/font");
|
|
27
|
-
|
|
28
17
|
var _color = require("@twreporter/core/lib/constants/color");
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
function _getRequireWildcardCache(
|
|
33
|
-
|
|
34
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
-
|
|
18
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10; // components
|
|
19
|
+
// constants
|
|
20
|
+
// @twreporter
|
|
21
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
36
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
37
|
-
|
|
38
24
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
39
|
-
|
|
40
|
-
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); } }
|
|
41
|
-
|
|
25
|
+
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); } }
|
|
42
26
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
43
|
-
|
|
27
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
28
|
+
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); }
|
|
44
29
|
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); }
|
|
45
|
-
|
|
46
30
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
47
|
-
|
|
48
31
|
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); }; }
|
|
49
|
-
|
|
50
32
|
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); }
|
|
51
|
-
|
|
52
33
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
53
|
-
|
|
54
34
|
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; } }
|
|
55
|
-
|
|
56
35
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
57
|
-
|
|
58
36
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
59
|
-
|
|
60
37
|
var styles = {
|
|
61
38
|
imgLandscape: {
|
|
62
39
|
mobile: {
|
|
@@ -85,36 +62,29 @@ var PostBox = /*#__PURE__*/(0, _styledComponents["default"])(_reactRouterDom.Lin
|
|
|
85
62
|
displayName: "post-item__PostBox",
|
|
86
63
|
componentId: "d3t92f-0"
|
|
87
64
|
})(["display:flex;", " ", " ", " ", " ", " ", ""], _mediaQuery["default"].mobileOnly(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: ", ";\n width: 100%;\n "])), (0, _css.arrayToCssShorthand)(styles.postBoxPadding.mobile)), _mediaQuery["default"].tabletOnly(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: ", "px;\n "])), styles.imgLandscape.tablet.width), _mediaQuery["default"].desktopAndAbove(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: ", "px;\n "])), styles.imgLandscape.desktop.width), _mediaQuery["default"].tabletAndAbove(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border: solid .5px ", ";\n overflow: hidden;\n flex-direction: column;\n "])), _color.colorGrayscale.gray300), _predefinedCss.resetLinkStyle, _predefinedCss.linkHoverFadeOut);
|
|
88
|
-
|
|
89
65
|
var PostImage = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
90
66
|
displayName: "post-item__PostImage",
|
|
91
67
|
componentId: "d3t92f-1"
|
|
92
68
|
})(["width:", "px;order:1;", " flex:0 0 auto;> div{width:", "px;height:", "px;", " ", "}"], styles.imgLandscape.mobile.width, _mediaQuery["default"].tabletAndAbove(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n width: ", "px;\n order: 2;\n "])), styles.imgLandscape.tablet.width), styles.imgLandscape.mobile.width, styles.imgLandscape.mobile.height, _mediaQuery["default"].tabletOnly(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: ", "px;\n height: ", "px;\n "])), styles.imgLandscape.tablet.width, styles.imgLandscape.tablet.height), _mediaQuery["default"].desktopAndAbove(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n width: ", "px;\n height: ", "px;\n "])), styles.imgLandscape.desktop.width, styles.imgLandscape.desktop.height));
|
|
93
|
-
|
|
94
69
|
var PostText = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
95
70
|
displayName: "post-item__PostText",
|
|
96
71
|
componentId: "d3t92f-2"
|
|
97
72
|
})(["color:", ";font-weight:", ";font-family:", ";font-size:16px;line-height:1.5;flex:1 1 auto;white-space:normal;order:2;", " padding:", ";", " ", ""], _color.colorGrayscale.gray900, _font.fontWeight.bold, _font.fontFamily.title, _mediaQuery["default"].tabletAndAbove(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n order: 1;\n "]))), (0, _css.arrayToCssShorthand)(styles.textBlockPadding.mobile), _mediaQuery["default"].tabletOnly(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n padding: ", ";\n line-height: 1.33;\n "])), (0, _css.arrayToCssShorthand)(styles.textBlockPadding.tablet)), _mediaQuery["default"].desktopAndAbove(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n padding: ", ";\n line-height: 1.25;\n "])), (0, _css.arrayToCssShorthand)(styles.textBlockPadding.desktop)));
|
|
98
|
-
|
|
99
73
|
var PostItem = /*#__PURE__*/function (_PureComponent) {
|
|
100
74
|
_inherits(PostItem, _PureComponent);
|
|
101
|
-
|
|
102
75
|
var _super = _createSuper(PostItem);
|
|
103
|
-
|
|
104
76
|
function PostItem() {
|
|
105
77
|
_classCallCheck(this, PostItem);
|
|
106
|
-
|
|
107
78
|
return _super.apply(this, arguments);
|
|
108
79
|
}
|
|
109
|
-
|
|
110
80
|
_createClass(PostItem, [{
|
|
111
81
|
key: "render",
|
|
112
82
|
value: function render() {
|
|
113
83
|
var _this$props = this.props,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
84
|
+
title = _this$props.title,
|
|
85
|
+
imgUrl = _this$props.imgUrl,
|
|
86
|
+
linkTo = _this$props.linkTo,
|
|
87
|
+
linkTarget = _this$props.linkTarget;
|
|
118
88
|
return /*#__PURE__*/_react["default"].createElement(PostBox, {
|
|
119
89
|
to: linkTo,
|
|
120
90
|
target: linkTarget
|
|
@@ -124,10 +94,8 @@ var PostItem = /*#__PURE__*/function (_PureComponent) {
|
|
|
124
94
|
}))), /*#__PURE__*/_react["default"].createElement(PostText, null, title));
|
|
125
95
|
}
|
|
126
96
|
}]);
|
|
127
|
-
|
|
128
97
|
return PostItem;
|
|
129
98
|
}(_react.PureComponent);
|
|
130
|
-
|
|
131
99
|
PostItem.propTypes = {
|
|
132
100
|
title: _propTypes["default"].string.isRequired,
|
|
133
101
|
imgUrl: _propTypes["default"].string.isRequired,
|
|
@@ -137,5 +105,4 @@ PostItem.propTypes = {
|
|
|
137
105
|
PostItem.defaultProps = {
|
|
138
106
|
linkTarget: null
|
|
139
107
|
};
|
|
140
|
-
var _default = PostItem;
|
|
141
|
-
exports["default"] = _default;
|
|
108
|
+
var _default = exports["default"] = PostItem;
|
|
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
9
|
-
|
|
10
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
-
|
|
12
9
|
var _color = require("@twreporter/core/lib/constants/color");
|
|
13
|
-
|
|
14
10
|
var _templateObject;
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
|
-
|
|
20
13
|
var PostsContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
21
14
|
displayName: "posts__PostsContainer",
|
|
22
15
|
componentId: "sc-16za9fh-0"
|
|
23
16
|
})(["display:flex;justify-content:space-between;align-items:stretch;", ""], _mediaQuery["default"].mobileOnly(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex-direction: column;\n justify-content: flex-start;\n a {\n border-bottom: solid 1px ", ";\n }\n a:last-child {\n border-bottom: medium none currentcolor;\n }\n "])), _color.colorGrayscale.gray300));
|
|
24
|
-
|
|
25
|
-
var _default = PostsContainer;
|
|
26
|
-
exports["default"] = _default;
|
|
17
|
+
var _default = exports["default"] = PostsContainer;
|