@twreporter/react-components 8.17.0-rc.8 → 8.17.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/lib/listing-page/components/list.js +7 -4
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [8.17.0-rc.9](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.17.0-rc.8...@twreporter/react-components@8.17.0-rc.9) (2023-04-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* add `showCategory` prop for List component ([20da390](https://github.com/twreporter/twreporter-npm-packages/commit/20da3909f564a660490e81391d989df452a0ac9c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [8.17.0-rc.8](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.17.0-rc.7...@twreporter/react-components@8.17.0-rc.8) (2023-04-27)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @twreporter/react-components
|
|
@@ -109,7 +109,8 @@ var List = /*#__PURE__*/function (_PureComponent) {
|
|
|
109
109
|
catName = _this$props.catName,
|
|
110
110
|
tagName = _this$props.tagName,
|
|
111
111
|
isFetching = _this$props.isFetching,
|
|
112
|
-
showSpinner = _this$props.showSpinner
|
|
112
|
+
showSpinner = _this$props.showSpinner,
|
|
113
|
+
showCategory = _this$props.showCategory;
|
|
113
114
|
var listJSX = [];
|
|
114
115
|
|
|
115
116
|
_.forEach(data, function (item) {
|
|
@@ -145,7 +146,7 @@ var List = /*#__PURE__*/function (_PureComponent) {
|
|
|
145
146
|
// In cases which do not have `hero_image`, display `og_image` as fallback.
|
|
146
147
|
src: _.get(item, 'hero_image.resized_targets.mobile.url') || _.get(item, 'og_image.resized_targets.mobile.url')
|
|
147
148
|
},
|
|
148
|
-
category: _.get(item, '
|
|
149
|
+
category: showCategory && _.get(item, 'category_set.0.category.name', ''),
|
|
149
150
|
pubDate: (0, _date.date2yyyymmdd)(_.get(item, 'published_date', ''), '.'),
|
|
150
151
|
tags: tags,
|
|
151
152
|
link: {
|
|
@@ -172,7 +173,8 @@ List.defaultProps = {
|
|
|
172
173
|
catName: '',
|
|
173
174
|
tagName: '',
|
|
174
175
|
isFetching: false,
|
|
175
|
-
showSpinner: false
|
|
176
|
+
showSpinner: false,
|
|
177
|
+
showCategory: false
|
|
176
178
|
};
|
|
177
179
|
List.propTypes = {
|
|
178
180
|
data: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
@@ -188,7 +190,8 @@ List.propTypes = {
|
|
|
188
190
|
tagName: _propTypes["default"].string,
|
|
189
191
|
catName: _propTypes["default"].string,
|
|
190
192
|
isFetching: _propTypes["default"].bool,
|
|
191
|
-
showSpinner: _propTypes["default"].bool
|
|
193
|
+
showSpinner: _propTypes["default"].bool,
|
|
194
|
+
showCategory: _propTypes["default"].bool
|
|
192
195
|
};
|
|
193
196
|
var _default = List;
|
|
194
197
|
exports["default"] = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twreporter/react-components",
|
|
3
|
-
"version": "8.17.0-rc.
|
|
3
|
+
"version": "8.17.0-rc.9",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"repository": "https://github.com/twreporter/twreporter-npm-packages.git",
|
|
6
6
|
"author": "twreporter <developer@twreporter.org>",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"babel-loader": "^8.2.4",
|
|
45
45
|
"chromatic": "^6.5.4"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "b19c17b200ea41950a1ea26d71d8d983d18549b0"
|
|
48
48
|
}
|