@arcblock/ux 2.1.11 → 2.1.15

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.
@@ -120,7 +120,7 @@ function CustomToolbar(props) {
120
120
 
121
121
  if (!(options.download === false || options.download === 'false')) {
122
122
  defaultButtons.push({
123
- Icon: _CloudDownload.default,
123
+ icon: /*#__PURE__*/_react.default.createElement(_CloudDownload.default, null),
124
124
  title: downloadCsv,
125
125
  onClick: () => {
126
126
  (0, _utils.handleCSVDownload)(props);
@@ -130,7 +130,7 @@ function CustomToolbar(props) {
130
130
 
131
131
  if (!(options.viewColumns === false || options.viewColumns === 'false')) {
132
132
  defaultButtons.push({
133
- Icon: _ViewColumn.default,
133
+ icon: /*#__PURE__*/_react.default.createElement(_ViewColumn.default, null),
134
134
  title: viewColumns,
135
135
 
136
136
  popRender() {
@@ -149,7 +149,7 @@ function CustomToolbar(props) {
149
149
 
150
150
  if (!(options.filter === false || options.filter === 'false')) {
151
151
  defaultButtons.push({
152
- Icon: _FilterList.default,
152
+ icon: /*#__PURE__*/_react.default.createElement(_FilterList.default, null),
153
153
  title: filterTable,
154
154
 
155
155
  popRender() {
@@ -181,10 +181,10 @@ function CustomToolbar(props) {
181
181
 
182
182
  const popId = getPopId(index);
183
183
 
184
- if (e.Icon) {
184
+ if (e.icon) {
185
185
  const {
186
- Icon,
187
- popRender
186
+ popRender,
187
+ icon
188
188
  } = e; // When popRender is present, clicking the button will bubble up the content returned by the popRender
189
189
 
190
190
  if (popRender) {
@@ -221,7 +221,9 @@ function CustomToolbar(props) {
221
221
  });
222
222
  }
223
223
  }
224
- }, /*#__PURE__*/_react.default.createElement(Icon, null)));
224
+ }, /*#__PURE__*/_react.default.createElement("div", {
225
+ className: "custom-toolbar-icon"
226
+ }, icon)));
225
227
  }
226
228
 
227
229
  return e;
@@ -233,13 +235,11 @@ function CustomToolbar(props) {
233
235
 
234
236
  if ( /*#__PURE__*/(0, _react.isValidElement)(e)) {
235
237
  content = e;
236
- } else if (e.Icon) {
238
+ } else if (e.icon) {
237
239
  const {
238
- Icon
240
+ icon
239
241
  } = e;
240
- content = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(Icon, {
241
- fontSize: "small"
242
- })), /*#__PURE__*/_react.default.createElement(_ListItemText.default, null, e.title));
242
+ content = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, icon), /*#__PURE__*/_react.default.createElement(_ListItemText.default, null, e.title));
243
243
  }
244
244
 
245
245
  return /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
@@ -314,7 +314,9 @@ function CustomToolbar(props) {
314
314
  })), /*#__PURE__*/_react.default.createElement(_ListItemText.default, null, print));
315
315
  }), menuItems), allPops.map((e, index) => /*#__PURE__*/_react.default.createElement("div", {
316
316
  key: getPopId(index)
317
- }, e)), loading && /*#__PURE__*/_react.default.createElement(_LinearProgress.default, null));
317
+ }, e)), /*#__PURE__*/_react.default.createElement(ProgressContainer, null, loading && /*#__PURE__*/_react.default.createElement(_LinearProgress.default, {
318
+ className: "toolbar-progress"
319
+ })));
318
320
  }
319
321
 
320
322
  CustomToolbar.propTypes = {
@@ -347,4 +349,9 @@ CustomToolbar.defaultProps = {
347
349
  const Container = _styledComponents.default.div.withConfig({
348
350
  displayName: "CustomToolbar__Container",
349
351
  componentId: "sc-cvz3dp-0"
350
- })(["display:flex;align-items:center;height:56px;.custom-toobar-title{position:relative;flex:1;font-size:18px;font-weight:800;height:56px;transition:all ease 0.3s;&-inner{line-height:56px;width:100%;height:56px;position:absolute;left:0;top:0;span{display:inline-block;max-width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}}}.custom-toobar-btns{display:flex;justify-content:center;align-items:center;&.toobar-btns-disabled{position:relative;opacity:0.5;&:after{position:absolute;display:block;z-index:2;width:100%;height:100%;left:0;top:0;content:'';cursor:not-allowed;}}}.toobar-title-hidden{opacity:0;cursor:none;}"]);
352
+ })(["display:flex;align-items:center;height:56px;.custom-toobar-title{position:relative;flex:1;font-size:18px;font-weight:800;height:56px;transition:all ease 0.3s;&-inner{line-height:56px;width:100%;height:56px;position:absolute;left:0;top:0;span{display:inline-block;max-width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}}}.custom-toobar-btns{display:flex;justify-content:center;align-items:center;&.toobar-btns-disabled{position:relative;opacity:0.5;&:after{position:absolute;display:block;z-index:2;width:100%;height:100%;left:0;top:0;content:'';cursor:not-allowed;}}.custom-toolbar-icon{display:flex;justify-content:center;align-items:center;width:24px;height:24px;font-size:20px;overflow:hidden;}}.toobar-title-hidden{opacity:0;cursor:none;}"]);
353
+
354
+ const ProgressContainer = _styledComponents.default.div.withConfig({
355
+ displayName: "CustomToolbar__ProgressContainer",
356
+ componentId: "sc-cvz3dp-1"
357
+ })(["width:100%;height:2px;.toolbar-progress{height:2px;}"]);
@@ -21,7 +21,7 @@ var _CustomToolbar = _interopRequireDefault(require("./CustomToolbar"));
21
21
 
22
22
  var _DatatableContext = require("./DatatableContext");
23
23
 
24
- const _excluded = ["data", "columns", "locale", "options", "style", "customButtons", "onChange", "loading", "disabled"];
24
+ const _excluded = ["data", "columns", "locale", "options", "style", "customButtons", "onChange", "loading", "disabled", "stripped"];
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
27
 
@@ -62,7 +62,8 @@ function ReDatatable(_ref2) {
62
62
  customButtons,
63
63
  onChange,
64
64
  loading,
65
- disabled
65
+ disabled,
66
+ stripped
66
67
  } = _ref2,
67
68
  rest = _objectWithoutProperties(_ref2, _excluded);
68
69
 
@@ -268,7 +269,8 @@ function ReDatatable(_ref2) {
268
269
  loading: _propTypes.default.bool,
269
270
  disabled: _propTypes.default.bool,
270
271
  customButtons: _propTypes.default.array,
271
- onChange: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string])
272
+ onChange: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
273
+ stripped: _propTypes.default.bool
272
274
  };
273
275
  ReDatatable.defaultProps = {
274
276
  options: {},
@@ -277,10 +279,12 @@ function ReDatatable(_ref2) {
277
279
  loading: false,
278
280
  disabled: false,
279
281
  customButtons: [],
280
- onChange: ''
282
+ onChange: '',
283
+ stripped: false
281
284
  };
282
285
  return /*#__PURE__*/_react.default.createElement(TableContainer, {
283
286
  ref: container,
287
+ className: stripped ? 'datatable-stripped' : '',
284
288
  style: style
285
289
  }, /*#__PURE__*/_react.default.createElement(_muiDatatables.default, Object.assign({
286
290
  data: data,
@@ -291,7 +295,7 @@ function ReDatatable(_ref2) {
291
295
  const TableContainer = _styledComponents.default.div.withConfig({
292
296
  displayName: "Datatable__TableContainer",
293
297
  componentId: "sc-1ju12vq-0"
294
- })(["height:100%;> .MuiPaper-root{display:flex;flex-direction:column;height:100%;box-shadow:none;}", "{[class*='MUIDataTableBody-emptyTitle']{padding-left:16px;width:200%;margin-left:-100%;text-align:center;}}"], props => props.theme.breakpoints.down('md'));
298
+ })(["height:100%;> .MuiPaper-root{display:flex;flex-direction:column;height:100%;box-shadow:none;}", "{[class*='MUIDataTableBody-emptyTitle']{padding-left:16px;width:200%;margin-left:-100%;text-align:center;}}&.datatable-stripped{.MuiTableBody-root{tr:nth-of-type(odd){background-color:", ";}}}"], props => props.theme.breakpoints.down('md'), props => props.theme.palette.action.hover);
295
299
 
296
300
  const FilterLine = _styledComponents.default.div.withConfig({
297
301
  displayName: "Datatable__FilterLine",
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ErrorFallback = ErrorFallback;
7
+ exports.ErrorFallbackRetry = ErrorFallbackRetry;
8
+
9
+ var _react = _interopRequireDefault(require("react"));
10
+
11
+ var _propTypes = _interopRequireDefault(require("prop-types"));
12
+
13
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
14
+
15
+ var _useTheme = _interopRequireDefault(require("@mui/styles/useTheme"));
16
+
17
+ var _colors = require("@mui/material/colors");
18
+
19
+ var _Button = _interopRequireDefault(require("../Button"));
20
+
21
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
+
23
+ function InternalErrorFallback(_ref) {
24
+ let {
25
+ title,
26
+ desc,
27
+ retryFunc
28
+ } = _ref;
29
+ const theme = (0, _useTheme.default)();
30
+ return /*#__PURE__*/_react.default.createElement(Root, {
31
+ role: "alert",
32
+ $theme: theme
33
+ }, /*#__PURE__*/_react.default.createElement("h3", null, title), /*#__PURE__*/_react.default.createElement("pre", null, desc), retryFunc && /*#__PURE__*/_react.default.createElement(_Button.default, {
34
+ variant: "contained",
35
+ color: "error",
36
+ size: "small",
37
+ onClick: retryFunc
38
+ }, "Try again"));
39
+ }
40
+
41
+ InternalErrorFallback.propTypes = {
42
+ title: _propTypes.default.string,
43
+ desc: _propTypes.default.string.isRequired,
44
+ retryFunc: _propTypes.default.func
45
+ };
46
+ InternalErrorFallback.defaultProps = {
47
+ title: 'Something went wrong...',
48
+ retryFunc: null
49
+ };
50
+
51
+ function ErrorFallback(_ref2) {
52
+ let {
53
+ error
54
+ } = _ref2;
55
+ return /*#__PURE__*/_react.default.createElement(InternalErrorFallback, {
56
+ desc: error.message
57
+ });
58
+ }
59
+
60
+ ErrorFallback.propTypes = {
61
+ error: _propTypes.default.instanceOf(Error).isRequired
62
+ };
63
+
64
+ function ErrorFallbackRetry(_ref3) {
65
+ let {
66
+ error,
67
+ resetErrorBoundary
68
+ } = _ref3;
69
+ return /*#__PURE__*/_react.default.createElement(InternalErrorFallback, {
70
+ desc: error.message,
71
+ retryFunc: resetErrorBoundary
72
+ });
73
+ }
74
+
75
+ ErrorFallbackRetry.propTypes = {
76
+ error: _propTypes.default.instanceOf(Error).isRequired,
77
+ resetErrorBoundary: _propTypes.default.func.isRequired
78
+ };
79
+
80
+ const Root = _styledComponents.default.div.withConfig({
81
+ displayName: "fallback__Root",
82
+ componentId: "sc-1ajge2q-0"
83
+ })(["padding:16px;border:2px solid ", ";border-radius:4px;color:", ";background-color:", ";font-size:14px;h3{margin:0;font-size:16px;}pre{white-space:normal;}"], props => props.$theme.palette.error.main, props => props.$theme.palette.error.main, _colors.red[50]);
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _fallback = require("./fallback");
8
+
9
+ Object.keys(_fallback).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _fallback[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _fallback[key];
16
+ }
17
+ });
18
+ });
@@ -90,7 +90,7 @@ Header.defaultProps = {
90
90
  const Root = _styledComponents.default.div.withConfig({
91
91
  displayName: "header__Root",
92
92
  componentId: "sc-15qnwg1-0"
93
- })(["position:relative;z-index:", ";font-size:14px;background:", ";.header-container{display:flex;align-items:center;height:64px;}.header-logo{display:inline-flex;justify-content:center;position:relative;height:40px;margin-right:16px;img,svg{width:auto;height:100%;}> a{height:100%;line-height:1;}> a::before{position:absolute;top:0;right:0;bottom:0;left:0;background-color:transparent;content:'';}}.header-brand{display:flex;flex-direction:column;flex-shrink:0;margin-right:16px;.header-brand-title{display:flex;align-items:center;h2{font-size:16px;}.header-brand-addon{margin-left:8px;}}.header-brand-desc{color:#9397a1;}}.header-addons{display:flex;align-items:center;}", "{.header-brand{margin-right:12px;.header-brand-title{h2{font-size:14px;}}}}", "{.header-container{height:56px;}.header-menu{display:inline-block;}.header-logo{height:32px;}.header-brand{display:none;}}"], props => props.$theme.zIndex.drawer + 1, props => props.$theme.palette.common.white, props => props.$theme.breakpoints.down('lg'), props => props.$theme.breakpoints.down('md'));
93
+ })(["position:relative;z-index:", ";font-size:14px;background:", ";.header-container{display:flex;align-items:center;height:64px;}.header-logo{display:inline-flex;position:relative;height:40px;margin-right:16px;img,svg{width:auto;height:100%;}> a{height:100%;line-height:1;}> a::before{position:absolute;top:0;right:0;bottom:0;left:0;background-color:transparent;content:'';}}.header-brand{display:flex;flex-direction:column;flex-shrink:0;margin-right:16px;.header-brand-title{display:flex;align-items:center;h2{font-size:16px;}.header-brand-addon{margin-left:8px;}}.header-brand-desc{color:#9397a1;}}.header-addons{display:flex;align-items:center;> *:last-child{padding-right:0;}}", "{.header-brand{margin-right:12px;.header-brand-title{h2{font-size:14px;}}}}", "{.header-container{height:56px;}.header-menu{display:inline-block;}.header-logo{height:32px;}.header-brand{display:none;}}"], props => props.$theme.zIndex.drawer + 1, props => props.$theme.palette.common.white, props => props.$theme.breakpoints.down('lg'), props => props.$theme.breakpoints.down('md'));
94
94
 
95
95
  var _default = Header;
96
96
  exports.default = _default;
@@ -22,7 +22,7 @@ function OpenInWallet(_ref) {
22
22
  locale,
23
23
  link
24
24
  } = _ref;
25
- const buttonText = locale === 'zh' ? '在 ABT 钱包打开' : 'Open in DID Wallet';
25
+ const buttonText = locale === 'zh' ? '在 DID 钱包打开' : 'Open in DID Wallet';
26
26
  const browser = (0, _useBrowser.default)();
27
27
 
28
28
  if (browser.mobile.any && !browser.wallet && !browser.wechat) {
@@ -42,7 +42,7 @@ function WechatPrompt() {
42
42
  className: "wechat-tip"
43
43
  }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
44
44
  className: "wechat-tip-text"
45
- }, "2. \u70B9\u51FB\u201C\u5728\u6D4F\u89C8\u5668\u6253\u5F00\u201D\uFF0C\u624D\u80FD\u8C03\u8D77 ABT \u94B1\u5305"), /*#__PURE__*/_react.default.createElement("img", {
45
+ }, "2. \u70B9\u51FB\u201C\u5728\u6D4F\u89C8\u5668\u6253\u5F00\u201D\uFF0C\u624D\u80FD\u8C03\u8D77 DID \u94B1\u5305"), /*#__PURE__*/_react.default.createElement("img", {
46
46
  className: "wechat-tip-img",
47
47
  src: _android.default,
48
48
  alt: "Open in Android Browser"
@@ -58,7 +58,7 @@ function WechatPrompt() {
58
58
  className: "wechat-tip"
59
59
  }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
60
60
  className: "wechat-tip-text"
61
- }, "2. \u70B9\u51FB\u201C\u5728Safari\u4E2D\u6253\u5F00\u201D\uFF0C\u624D\u80FD\u8C03\u8D77 ABT \u94B1\u5305"), /*#__PURE__*/_react.default.createElement("img", {
61
+ }, "2. \u70B9\u51FB\u201C\u5728Safari\u4E2D\u6253\u5F00\u201D\uFF0C\u624D\u80FD\u8C03\u8D77 DID \u94B1\u5305"), /*#__PURE__*/_react.default.createElement("img", {
62
62
  className: "wechat-tip-img",
63
63
  src: _ios.default,
64
64
  alt: "Open in Safari"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.1.11",
3
+ "version": "2.1.15",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -52,10 +52,10 @@
52
52
  "react": ">=18.1.0",
53
53
  "react-ga": "^2.7.0"
54
54
  },
55
- "gitHead": "ce03cc62eb231442c6c2e29d262ea073925a8cb2",
55
+ "gitHead": "7cf6582840eac13158ecc4e25ec6ec13cdb97799",
56
56
  "dependencies": {
57
- "@arcblock/icons": "^2.1.11",
58
- "@arcblock/react-hooks": "^2.1.11",
57
+ "@arcblock/icons": "^2.1.15",
58
+ "@arcblock/react-hooks": "^2.1.15",
59
59
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
60
60
  "@emotion/react": "^11.9.0",
61
61
  "@emotion/styled": "^11.8.1",
@@ -78,6 +78,7 @@
78
78
  "mui-datatables": "^4.2.2",
79
79
  "notistack": "^2.0.5",
80
80
  "react-cookie-consent": "^6.4.1",
81
+ "react-error-boundary": "^3.1.4",
81
82
  "react-helmet": "^6.1.0",
82
83
  "react-intersection-observer": "^8.31.1",
83
84
  "react-lottie-player": "^1.4.2",
@@ -84,7 +84,7 @@ export default function CustomToolbar(props) {
84
84
  // download/viewColumns/filter button behaviours, rendered using custom button logic
85
85
  if (!(options.download === false || options.download === 'false')) {
86
86
  defaultButtons.push({
87
- Icon: DownloadIcon,
87
+ icon: <DownloadIcon />,
88
88
  title: downloadCsv,
89
89
  onClick: () => {
90
90
  handleCSVDownload(props);
@@ -94,7 +94,7 @@ export default function CustomToolbar(props) {
94
94
 
95
95
  if (!(options.viewColumns === false || options.viewColumns === 'false')) {
96
96
  defaultButtons.push({
97
- Icon: ViewColumnIcon,
97
+ icon: <ViewColumnIcon />,
98
98
  title: viewColumns,
99
99
  popRender() {
100
100
  return (
@@ -113,7 +113,7 @@ export default function CustomToolbar(props) {
113
113
 
114
114
  if (!(options.filter === false || options.filter === 'false')) {
115
115
  defaultButtons.push({
116
- Icon: FilterIcon,
116
+ icon: <FilterIcon />,
117
117
  title: filterTable,
118
118
  popRender() {
119
119
  return (
@@ -148,8 +148,8 @@ export default function CustomToolbar(props) {
148
148
 
149
149
  const popId = getPopId(index);
150
150
 
151
- if (e.Icon) {
152
- const { Icon, popRender } = e;
151
+ if (e.icon) {
152
+ const { popRender, icon } = e;
153
153
  // When popRender is present, clicking the button will bubble up the content returned by the popRender
154
154
  if (popRender) {
155
155
  allPops.push(
@@ -187,7 +187,7 @@ export default function CustomToolbar(props) {
187
187
  });
188
188
  }
189
189
  }}>
190
- <Icon />
190
+ <div className="custom-toolbar-icon">{icon}</div>
191
191
  </IconButton>
192
192
  </Tooltip>
193
193
  );
@@ -204,14 +204,12 @@ export default function CustomToolbar(props) {
204
204
 
205
205
  if (isValidElement(e)) {
206
206
  content = e;
207
- } else if (e.Icon) {
208
- const { Icon } = e;
207
+ } else if (e.icon) {
208
+ const { icon } = e;
209
209
 
210
210
  content = (
211
211
  <>
212
- <ListItemIcon>
213
- <Icon fontSize="small" />
214
- </ListItemIcon>
212
+ <ListItemIcon>{icon}</ListItemIcon>
215
213
  <ListItemText>{e.title}</ListItemText>
216
214
  </>
217
215
  );
@@ -319,7 +317,9 @@ export default function CustomToolbar(props) {
319
317
  {allPops.map((e, index) => (
320
318
  <div key={getPopId(index)}>{e}</div>
321
319
  ))}
322
- {loading && <LinearProgress />}
320
+ <ProgressContainer>
321
+ {loading && <LinearProgress className="toolbar-progress" />}
322
+ </ProgressContainer>
323
323
  </div>
324
324
  );
325
325
  }
@@ -398,9 +398,26 @@ const Container = styled.div`
398
398
  cursor: not-allowed;
399
399
  }
400
400
  }
401
+ .custom-toolbar-icon {
402
+ display: flex;
403
+ justify-content: center;
404
+ align-items: center;
405
+ width: 24px;
406
+ height: 24px;
407
+ font-size: 20px;
408
+ overflow: hidden;
409
+ }
401
410
  }
402
411
  .toobar-title-hidden {
403
412
  opacity: 0;
404
413
  cursor: none;
405
414
  }
406
415
  `;
416
+
417
+ const ProgressContainer = styled.div`
418
+ width: 100%;
419
+ height: 2px;
420
+ .toolbar-progress {
421
+ height: 2px;
422
+ }
423
+ `;
@@ -32,6 +32,7 @@ function ReDatatable({
32
32
  onChange,
33
33
  loading,
34
34
  disabled,
35
+ stripped,
35
36
  ...rest
36
37
  }) {
37
38
  const container = useRef(null);
@@ -202,6 +203,7 @@ function ReDatatable({
202
203
  disabled: PropTypes.bool,
203
204
  customButtons: PropTypes.array,
204
205
  onChange: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
206
+ stripped: PropTypes.bool,
205
207
  };
206
208
 
207
209
  ReDatatable.defaultProps = {
@@ -212,10 +214,11 @@ function ReDatatable({
212
214
  disabled: false,
213
215
  customButtons: [],
214
216
  onChange: '',
217
+ stripped: false,
215
218
  };
216
219
 
217
220
  return (
218
- <TableContainer ref={container} style={style}>
221
+ <TableContainer ref={container} className={stripped ? 'datatable-stripped' : ''} style={style}>
219
222
  <MUIDataTable data={data} columns={columns} {...props} />
220
223
  </TableContainer>
221
224
  );
@@ -237,6 +240,13 @@ const TableContainer = styled.div`
237
240
  text-align: center;
238
241
  }
239
242
  }
243
+ &.datatable-stripped {
244
+ .MuiTableBody-root {
245
+ tr:nth-of-type(odd) {
246
+ background-color: ${props => props.theme.palette.action.hover};
247
+ }
248
+ }
249
+ }
240
250
  `;
241
251
 
242
252
  const FilterLine = styled.div`
@@ -0,0 +1,64 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
4
+ import useTheme from '@mui/styles/useTheme';
5
+ import { red } from '@mui/material/colors';
6
+ import Button from '../Button';
7
+
8
+ function InternalErrorFallback({ title, desc, retryFunc }) {
9
+ const theme = useTheme();
10
+ return (
11
+ <Root role="alert" $theme={theme}>
12
+ <h3>{title}</h3>
13
+ <pre>{desc}</pre>
14
+ {retryFunc && (
15
+ <Button variant="contained" color="error" size="small" onClick={retryFunc}>
16
+ Try again
17
+ </Button>
18
+ )}
19
+ </Root>
20
+ );
21
+ }
22
+
23
+ InternalErrorFallback.propTypes = {
24
+ title: PropTypes.string,
25
+ desc: PropTypes.string.isRequired,
26
+ retryFunc: PropTypes.func,
27
+ };
28
+ InternalErrorFallback.defaultProps = {
29
+ title: 'Something went wrong...',
30
+ retryFunc: null,
31
+ };
32
+
33
+ export function ErrorFallback({ error }) {
34
+ return <InternalErrorFallback desc={error.message} />;
35
+ }
36
+
37
+ ErrorFallback.propTypes = {
38
+ error: PropTypes.instanceOf(Error).isRequired,
39
+ };
40
+
41
+ export function ErrorFallbackRetry({ error, resetErrorBoundary }) {
42
+ return <InternalErrorFallback desc={error.message} retryFunc={resetErrorBoundary} />;
43
+ }
44
+
45
+ ErrorFallbackRetry.propTypes = {
46
+ error: PropTypes.instanceOf(Error).isRequired,
47
+ resetErrorBoundary: PropTypes.func.isRequired,
48
+ };
49
+
50
+ const Root = styled.div`
51
+ padding: 16px;
52
+ border: 2px solid ${props => props.$theme.palette.error.main};
53
+ border-radius: 4px;
54
+ color: ${props => props.$theme.palette.error.main};
55
+ background-color: ${red[50]};
56
+ font-size: 14px;
57
+ h3 {
58
+ margin: 0;
59
+ font-size: 16px;
60
+ }
61
+ pre {
62
+ white-space: normal;
63
+ }
64
+ `;
@@ -0,0 +1 @@
1
+ export * from './fallback';
@@ -68,7 +68,6 @@ const Root = styled.div`
68
68
  }
69
69
  .header-logo {
70
70
  display: inline-flex;
71
- justify-content: center;
72
71
  position: relative;
73
72
  height: 40px;
74
73
  margin-right: 16px;
@@ -113,6 +112,9 @@ const Root = styled.div`
113
112
  .header-addons {
114
113
  display: flex;
115
114
  align-items: center;
115
+ > *:last-child {
116
+ padding-right: 0;
117
+ }
116
118
  }
117
119
  ${props => props.$theme.breakpoints.down('lg')} {
118
120
  .header-brand {
@@ -5,7 +5,7 @@ import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
5
5
  import Fab from '@mui/material/Fab';
6
6
 
7
7
  export default function OpenInWallet({ locale, link }) {
8
- const buttonText = locale === 'zh' ? '在 ABT 钱包打开' : 'Open in DID Wallet';
8
+ const buttonText = locale === 'zh' ? '在 DID 钱包打开' : 'Open in DID Wallet';
9
9
  const browser = useBrowser();
10
10
 
11
11
  if (browser.mobile.any && !browser.wallet && !browser.wechat) {
@@ -26,7 +26,7 @@ export default function WechatPrompt() {
26
26
  <Typography className="wechat-title">1. 轻触右上方菜单</Typography>
27
27
  <div className="wechat-tip">
28
28
  <Typography className="wechat-tip-text">
29
- 2. 点击“在浏览器打开”,才能调起 ABT 钱包
29
+ 2. 点击“在浏览器打开”,才能调起 DID 钱包
30
30
  </Typography>
31
31
  <img className="wechat-tip-img" src={AndroidImage} alt="Open in Android Browser" />
32
32
  </div>
@@ -41,7 +41,7 @@ export default function WechatPrompt() {
41
41
  <Typography className="wechat-title">1. 轻触右上方菜单</Typography>
42
42
  <div className="wechat-tip">
43
43
  <Typography className="wechat-tip-text">
44
- 2. 点击“在Safari中打开”,才能调起 ABT 钱包
44
+ 2. 点击“在Safari中打开”,才能调起 DID 钱包
45
45
  </Typography>
46
46
  <img className="wechat-tip-img" src={IosImage} alt="Open in Safari" />
47
47
  </div>