@twreporter/react-components 9.0.3-rc.0 → 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 +11 -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 +9 -15
- 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,67 +1,41 @@
|
|
|
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 _reactRedux = require("react-redux");
|
|
11
|
-
|
|
12
9
|
var _CSSTransition = _interopRequireDefault(require("react-transition-group/CSSTransition"));
|
|
13
|
-
|
|
14
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
|
|
18
12
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
19
|
-
|
|
20
13
|
var _bookmarks = _interopRequireDefault(require("./bookmarks"));
|
|
21
|
-
|
|
22
14
|
var _confirmation = _interopRequireDefault(require("../confirmation"));
|
|
23
|
-
|
|
24
15
|
var _more = _interopRequireDefault(require("../more"));
|
|
25
|
-
|
|
26
16
|
var _redirectToSignIn = _interopRequireDefault(require("./redirect-to-sign-in"));
|
|
27
|
-
|
|
28
17
|
var _redux = _interopRequireDefault(require("@twreporter/redux"));
|
|
29
|
-
|
|
30
18
|
var _signInHref = require("@twreporter/core/lib/utils/sign-in-href");
|
|
31
|
-
|
|
32
19
|
var _propTypes2 = _interopRequireDefault(require("@twreporter/core/lib/constants/prop-types"));
|
|
33
|
-
|
|
34
20
|
var _releaseBranch = _interopRequireDefault(require("@twreporter/core/lib/constants/release-branch"));
|
|
35
|
-
|
|
36
21
|
var _findIndex = _interopRequireDefault(require("lodash/findIndex"));
|
|
37
|
-
|
|
38
22
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
39
|
-
|
|
40
23
|
var _map = _interopRequireDefault(require("lodash/map"));
|
|
41
|
-
|
|
42
24
|
var _slice = _interopRequireDefault(require("lodash/slice"));
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
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; }
|
|
47
|
-
|
|
25
|
+
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); }
|
|
26
|
+
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; }
|
|
48
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
49
|
-
|
|
50
28
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
51
|
-
|
|
52
29
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
53
|
-
|
|
54
30
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
55
|
-
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
61
|
-
|
|
31
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
32
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
33
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // components
|
|
34
|
+
// @twreporter
|
|
35
|
+
// lodash
|
|
62
36
|
var _twreporterRedux$acti = _redux["default"].actions,
|
|
63
|
-
|
|
64
|
-
|
|
37
|
+
deleteSingleBookmark = _twreporterRedux$acti.deleteSingleBookmark,
|
|
38
|
+
getMultipleBookmarks = _twreporterRedux$acti.getMultipleBookmarks;
|
|
65
39
|
var reduxStatePropKeys = _redux["default"].reduxStateFields;
|
|
66
40
|
var _ = {
|
|
67
41
|
findIndex: _findIndex["default"],
|
|
@@ -89,52 +63,43 @@ var transitionDuration = {
|
|
|
89
63
|
enter: 400,
|
|
90
64
|
leave: 300
|
|
91
65
|
};
|
|
92
|
-
|
|
93
66
|
var MoreContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
94
67
|
displayName: "bookmark-list__MoreContainer",
|
|
95
68
|
componentId: "w84xlj-0"
|
|
96
69
|
})(["display:", ";"], function (props) {
|
|
97
70
|
return props.$hasMore ? 'inline' : 'none';
|
|
98
71
|
});
|
|
99
|
-
|
|
100
72
|
var reactTransitionCSS = /*#__PURE__*/(0, _styledComponents.css)([".", "{opacity:0.01;}.", "{opacity:1;transition:opacity ", "ms ease;}.", "{opacity:1;}.", "{opacity:0.01;transition:opacity ", "ms ease;}"], transitionName.enter, transitionName.enterActive, transitionDuration.enter, transitionName.leave, transitionName.leaveActive, transitionDuration.leave);
|
|
101
|
-
|
|
102
73
|
var Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
103
74
|
displayName: "bookmark-list__Container",
|
|
104
75
|
componentId: "w84xlj-1"
|
|
105
76
|
})(["", ""], reactTransitionCSS);
|
|
106
|
-
|
|
107
77
|
var BookmarkList = function BookmarkList(_ref) {
|
|
108
78
|
var _ref$releaseBranch = _ref.releaseBranch,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
79
|
+
releaseBranch = _ref$releaseBranch === void 0 ? _releaseBranch["default"].master : _ref$releaseBranch,
|
|
80
|
+
bookmarks = _ref.bookmarks,
|
|
81
|
+
total = _ref.total,
|
|
82
|
+
getMultipleBookmarks = _ref.getMultipleBookmarks,
|
|
83
|
+
deleteSingleBookmark = _ref.deleteSingleBookmark,
|
|
84
|
+
isAuthed = _ref.isAuthed,
|
|
85
|
+
jwt = _ref.jwt,
|
|
86
|
+
userID = _ref.userID;
|
|
118
87
|
var _useState = (0, _react.useState)(false),
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
88
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
89
|
+
showConfirmation = _useState2[0],
|
|
90
|
+
setShowConfirmation = _useState2[1];
|
|
123
91
|
var _useState3 = (0, _react.useState)(),
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
92
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
93
|
+
idToBeDeleted = _useState4[0],
|
|
94
|
+
setIdToBeDeleted = _useState4[1];
|
|
128
95
|
var _useState5 = (0, _react.useState)(total <= defaultLimit ? total : defaultLimit),
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
96
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
97
|
+
numberToShow = _useState6[0],
|
|
98
|
+
setNumberToShow = _useState6[1];
|
|
133
99
|
var _useState7 = (0, _react.useState)(bookmarks),
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
100
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
101
|
+
bookmarkToShow = _useState8[0],
|
|
102
|
+
setBookmarkToShow = _useState8[1];
|
|
138
103
|
var _defaultBodyOverflow = 'scroll';
|
|
139
104
|
(0, _react.useEffect)(function () {
|
|
140
105
|
// check authorization
|
|
@@ -142,11 +107,12 @@ var BookmarkList = function BookmarkList(_ref) {
|
|
|
142
107
|
if (!isAuthed || !jwt) {
|
|
143
108
|
var currentHref = typeof window === 'undefined' ? '' : window.location.href;
|
|
144
109
|
window.location.href = (0, _signInHref.getSignInHref)(currentHref);
|
|
145
|
-
}
|
|
146
|
-
|
|
110
|
+
}
|
|
147
111
|
|
|
148
|
-
|
|
112
|
+
// set overflow value
|
|
113
|
+
_defaultBodyOverflow = _.get(document, 'body.style.overflow', _defaultBodyOverflow);
|
|
149
114
|
|
|
115
|
+
// check bookmark update
|
|
150
116
|
var offset = 0;
|
|
151
117
|
getMultipleBookmarks(jwt, userID, offset, defaultLimit, defaultSort);
|
|
152
118
|
}, []);
|
|
@@ -161,10 +127,8 @@ var BookmarkList = function BookmarkList(_ref) {
|
|
|
161
127
|
setNumberToShow(total);
|
|
162
128
|
}
|
|
163
129
|
}, [total]);
|
|
164
|
-
|
|
165
130
|
var loadMoreBookmarks = function loadMoreBookmarks() {
|
|
166
131
|
var nextNumberToShow = numberToShow + defaultLimit < total ? numberToShow + defaultLimit : total;
|
|
167
|
-
|
|
168
132
|
if (total === bookmarks.length) {
|
|
169
133
|
setNumberToShow(nextNumberToShow);
|
|
170
134
|
} else if (numberToShow < total) {
|
|
@@ -173,23 +137,18 @@ var BookmarkList = function BookmarkList(_ref) {
|
|
|
173
137
|
setNumberToShow(nextNumberToShow);
|
|
174
138
|
}
|
|
175
139
|
};
|
|
176
|
-
|
|
177
140
|
var hideComfirmation = function hideComfirmation() {
|
|
178
141
|
setShowConfirmation(false);
|
|
179
142
|
};
|
|
180
|
-
|
|
181
143
|
var showComfirmation = function showComfirmation() {
|
|
182
144
|
setShowConfirmation(true);
|
|
183
145
|
};
|
|
184
|
-
|
|
185
146
|
var handleDeleteButtonClicked = function handleDeleteButtonClicked(bookmarkID) {
|
|
186
147
|
setIdToBeDeleted(bookmarkID);
|
|
187
148
|
showComfirmation();
|
|
188
149
|
};
|
|
189
|
-
|
|
190
150
|
var handleDeletingConfirmed = function handleDeletingConfirmed() {
|
|
191
151
|
hideComfirmation();
|
|
192
|
-
|
|
193
152
|
if (typeof idToBeDeleted === 'number') {
|
|
194
153
|
deleteSingleBookmark(jwt, userID, idToBeDeleted);
|
|
195
154
|
} else {
|
|
@@ -198,11 +157,9 @@ var BookmarkList = function BookmarkList(_ref) {
|
|
|
198
157
|
|
|
199
158
|
setIdToBeDeleted(null);
|
|
200
159
|
};
|
|
201
|
-
|
|
202
160
|
if (!isAuthed || !jwt) {
|
|
203
161
|
return /*#__PURE__*/_react["default"].createElement(_redirectToSignIn["default"], null, "\u60A8\u5C1A\u672A\u767B\u5165\uFF0C\u5C07\u8DF3\u8F49\u81F3\u767B\u5165\u9801");
|
|
204
162
|
}
|
|
205
|
-
|
|
206
163
|
return /*#__PURE__*/_react["default"].createElement(Container, null, /*#__PURE__*/_react["default"].createElement(_bookmarks["default"], {
|
|
207
164
|
bookmarks: bookmarkToShow,
|
|
208
165
|
handleDelete: handleDeleteButtonClicked,
|
|
@@ -229,7 +186,6 @@ var BookmarkList = function BookmarkList(_ref) {
|
|
|
229
186
|
cancel: text.dialog.cancel
|
|
230
187
|
})));
|
|
231
188
|
};
|
|
232
|
-
|
|
233
189
|
BookmarkList.propTypes = {
|
|
234
190
|
releaseBranch: _propTypes2["default"].releaseBranch,
|
|
235
191
|
// Props below are provided by redux
|
|
@@ -244,24 +200,16 @@ BookmarkList.propTypes = {
|
|
|
244
200
|
BookmarkList.defaultProps = {
|
|
245
201
|
releaseBranch: _releaseBranch["default"].master
|
|
246
202
|
};
|
|
247
|
-
|
|
248
203
|
var mapStateToProps = function mapStateToProps(state) {
|
|
249
204
|
var bookmarkIDList = _.get(state, [reduxStatePropKeys.bookmarks, 'bookmarkIDList'], []);
|
|
250
|
-
|
|
251
205
|
var bookmarkEntities = _.get(state, [reduxStatePropKeys.bookmarks, 'entities'], {});
|
|
252
|
-
|
|
253
206
|
var bookmarks = _.map(bookmarkIDList, function (id) {
|
|
254
207
|
return _.get(bookmarkEntities, id);
|
|
255
208
|
});
|
|
256
|
-
|
|
257
209
|
var total = _.get(state, [reduxStatePropKeys.bookmarks, 'total'], 0);
|
|
258
|
-
|
|
259
210
|
var jwt = _.get(state, [reduxStatePropKeys.auth, 'accessToken']);
|
|
260
|
-
|
|
261
211
|
var userID = _.get(state, [reduxStatePropKeys.auth, 'userInfo', 'user_id']);
|
|
262
|
-
|
|
263
212
|
var isAuthed = _.get(state, [reduxStatePropKeys.auth, 'isAuthed']);
|
|
264
|
-
|
|
265
213
|
return {
|
|
266
214
|
bookmarks: bookmarks,
|
|
267
215
|
isAuthed: isAuthed,
|
|
@@ -270,10 +218,7 @@ var mapStateToProps = function mapStateToProps(state) {
|
|
|
270
218
|
userID: userID
|
|
271
219
|
};
|
|
272
220
|
};
|
|
273
|
-
|
|
274
|
-
var _default = (0, _reactRedux.connect)(mapStateToProps, {
|
|
221
|
+
var _default = exports["default"] = (0, _reactRedux.connect)(mapStateToProps, {
|
|
275
222
|
getMultipleBookmarks: getMultipleBookmarks,
|
|
276
223
|
deleteSingleBookmark: deleteSingleBookmark
|
|
277
|
-
})(BookmarkList);
|
|
278
|
-
|
|
279
|
-
exports["default"] = _default;
|
|
224
|
+
})(BookmarkList);
|
|
@@ -4,32 +4,23 @@ 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 = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
11
|
var Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
17
12
|
displayName: "redirect-to-sign-in__Container",
|
|
18
13
|
componentId: "sc-1b4wjsc-0"
|
|
19
14
|
})(["height:80vh;display:flex;justify-content:center;align-items:center;"]);
|
|
20
|
-
|
|
21
15
|
var Message = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
22
16
|
displayName: "redirect-to-sign-in__Message",
|
|
23
17
|
componentId: "sc-1b4wjsc-1"
|
|
24
18
|
})(["width:90%;text-align:center;"]);
|
|
25
|
-
|
|
26
19
|
var RedirectToSignIn = function RedirectToSignIn(_ref) {
|
|
27
20
|
var children = _ref.children;
|
|
28
21
|
return /*#__PURE__*/_react["default"].createElement(Container, null, /*#__PURE__*/_react["default"].createElement(Message, null, children));
|
|
29
22
|
};
|
|
30
|
-
|
|
31
23
|
RedirectToSignIn.propTypes = {
|
|
32
24
|
children: _propTypes["default"].node
|
|
33
25
|
};
|
|
34
|
-
var _default = RedirectToSignIn;
|
|
35
|
-
exports["default"] = _default;
|
|
26
|
+
var _default = exports["default"] = RedirectToSignIn;
|
|
@@ -4,25 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.emptyList = exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _bookmarks = _interopRequireDefault(require("../bookmarks"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
10
|
/* eslint react/display-name:0 */
|
|
15
|
-
var _default = {
|
|
11
|
+
var _default = exports["default"] = {
|
|
16
12
|
title: 'Bookmark/Empty List',
|
|
17
13
|
component: _bookmarks["default"]
|
|
18
14
|
};
|
|
19
|
-
exports
|
|
20
|
-
var emptyList = {
|
|
15
|
+
var emptyList = exports.emptyList = {
|
|
21
16
|
render: function render() {
|
|
22
17
|
return /*#__PURE__*/_react["default"].createElement(_bookmarks["default"], {
|
|
23
18
|
bookmarks: [],
|
|
24
19
|
handleDelete: function handleDelete() {}
|
|
25
20
|
});
|
|
26
21
|
}
|
|
27
|
-
};
|
|
28
|
-
exports.emptyList = emptyList;
|
|
22
|
+
};
|