@abtnode/ux 1.16.13-beta-55b3e93d → 1.16.13-beta-423a40b1

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.
@@ -4,18 +4,25 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = ConfigRoutingRule;
7
+ var _react = _interopRequireWildcard(require("react"));
7
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
8
9
  var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
9
10
  var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
10
11
  var _context = require("@arcblock/ux/lib/Locale/context");
11
12
  var _constant = require("@abtnode/constant");
13
+ var _constant2 = require("@blocklet/constant");
14
+ var _util = require("@blocklet/meta/lib/util");
15
+ var _blocklet = require("../../../contexts/blocklet");
12
16
  var _jsxRuntime = require("react/jsx-runtime");
13
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+ 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; }
14
20
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
21
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16
22
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
23
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
18
24
  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); }
25
+ const getComponents = blocklet => blocklet.children.filter(x => x.meta.interfaces.find(i => i.type === _constant2.BLOCKLET_INTERFACE_TYPE_WEB));
19
26
  function ConfigRoutingRule(_ref) {
20
27
  let {
21
28
  params,
@@ -26,12 +33,41 @@ function ConfigRoutingRule(_ref) {
26
33
  const {
27
34
  t
28
35
  } = (0, _context.useLocaleContext)();
36
+ const {
37
+ blocklet
38
+ } = (0, _blocklet.useBlockletContext)();
39
+ const teamDid = blocklet.meta.did;
40
+ const components = getComponents(blocklet);
41
+ const [pageGroups, setPageGroups] = (0, _react.useState)([]);
29
42
  const redirectCodesMap = {
30
43
  301: t('common.redirectPermanently'),
31
44
  302: t('common.redirectTemporary'),
32
45
  307: t('common.redirectTemporary'),
33
46
  308: t('common.redirectPermanently')
34
47
  };
48
+ (0, _react.useEffect)(() => {
49
+ if (params.type === _constant.ROUTING_RULE_TYPES.COMPONENT && params.componentId) {
50
+ const component = components.find(x => x.meta.did === params.componentId);
51
+ const webInterface = (0, _util.findWebInterface)(component.meta);
52
+ const groups = (Array.isArray(webInterface === null || webInterface === void 0 ? void 0 : webInterface.pageGroups) ? webInterface.pageGroups : []).map(x => ({
53
+ value: x,
54
+ label: "".concat(x, " pages")
55
+ }));
56
+ if (groups.length) {
57
+ groups.unshift({
58
+ value: '',
59
+ label: 'All pages'
60
+ });
61
+ }
62
+ setPageGroups(groups);
63
+ if (params.pageGroup && groups.find(x => x.value === params.pageGroup) === false) {
64
+ setParams(_objectSpread(_objectSpread({}, params), {}, {
65
+ pageGroups: ''
66
+ }));
67
+ }
68
+ }
69
+ // eslint-disable-next-line react-hooks/exhaustive-deps
70
+ }, [params.componentId, params.type]);
35
71
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
36
72
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
37
73
  select: true,
@@ -46,6 +82,7 @@ function ConfigRoutingRule(_ref) {
46
82
  setError('');
47
83
  setParams(_objectSpread(_objectSpread({}, params), {}, {
48
84
  type: e.target.value,
85
+ did: e.target.value === _constant.ROUTING_RULE_TYPES.BLOCKLET ? teamDid : '',
49
86
  __disableConfirm: false
50
87
  }));
51
88
  },
@@ -82,14 +119,13 @@ function ConfigRoutingRule(_ref) {
82
119
  value: code,
83
120
  children: "".concat(redirectCodesMap[code], " - ").concat(code)
84
121
  }, code))
85
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
122
+ }, "redirectCode"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
86
123
  label: t('common.redirectUrl'),
87
124
  autoComplete: "off",
88
125
  variant: "outlined",
89
126
  name: "url",
90
127
  "data-cy": "redirect-url-input",
91
128
  fullWidth: true,
92
- autoFocus: true,
93
129
  value: params.url,
94
130
  helperText: t('router.urlHelperText'),
95
131
  style: {
@@ -106,7 +142,77 @@ function ConfigRoutingRule(_ref) {
106
142
  setError('');
107
143
  }
108
144
  }
109
- })]]
145
+ }, "redirectUrl")], params.type === _constant.ROUTING_RULE_TYPES.COMPONENT && [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
146
+ select: true,
147
+ label: t('router.domain.add.component'),
148
+ autoComplete: "off",
149
+ variant: "outlined",
150
+ "data-cy": "select-component-input",
151
+ name: "componentId",
152
+ fullWidth: true,
153
+ value: params.componentId,
154
+ onChange: e => {
155
+ setParams(_objectSpread(_objectSpread({}, params), {}, {
156
+ componentId: e.target.value
157
+ }));
158
+ },
159
+ style: {
160
+ marginBottom: 32
161
+ },
162
+ SelectProps: {},
163
+ children: components.map(component => /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
164
+ value: component.meta.did,
165
+ selected: component.meta.did === params.componentId,
166
+ children: (0, _util.getDisplayName)(component, true)
167
+ }, component.meta.did))
168
+ }, "componentId"), pageGroups.length ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
169
+ select: true,
170
+ label: t('router.domain.add.pageGroup'),
171
+ autoComplete: "off",
172
+ variant: "outlined",
173
+ name: "pageGroup",
174
+ "data-cy": "route-group-input",
175
+ fullWidth: true,
176
+ value: params.pageGroup,
177
+ helperText: t('router.domain.add.pageGroupTip'),
178
+ style: {
179
+ marginBottom: 32
180
+ },
181
+ onChange: e => {
182
+ setParams(_objectSpread(_objectSpread({}, params), {}, {
183
+ pageGroup: e.target.value
184
+ }));
185
+ },
186
+ SelectProps: {},
187
+ children: pageGroups.map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
188
+ value: x.value,
189
+ selected: x.value === params.pageGroup,
190
+ children: x.label
191
+ }, x.label))
192
+ }, "pageGroup") : null].filter(Boolean), params.type === _constant.ROUTING_RULE_TYPES.GENERAL_REWRITE && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
193
+ label: t('common.rewriteUrl'),
194
+ autoComplete: "off",
195
+ variant: "outlined",
196
+ name: "url",
197
+ "data-cy": "rewrite-url-input",
198
+ fullWidth: true,
199
+ value: params.url,
200
+ helperText: t('router.urlHelperText'),
201
+ style: {
202
+ marginBottom: 32
203
+ },
204
+ onChange: e => {
205
+ setParams(_objectSpread(_objectSpread({}, params), {}, {
206
+ url: e.target.value,
207
+ __disableConfirm: !e.target.value.trim()
208
+ }));
209
+ if (!e.target.value.trim()) {
210
+ setError(t('router.validation.rewriteUrlRequired'));
211
+ } else {
212
+ setError('');
213
+ }
214
+ }
215
+ }, "url")]
110
216
  });
111
217
  }
112
218
  ConfigRoutingRule.propTypes = {
@@ -123,6 +229,12 @@ ConfigRoutingRule.defaultProps = {
123
229
  }, {
124
230
  name: 'Default - User will see the 404 page',
125
231
  value: _constant.ROUTING_RULE_TYPES.NONE
232
+ }, {
233
+ name: 'Rewrite - Route traffic without redirect',
234
+ value: _constant.ROUTING_RULE_TYPES.GENERAL_REWRITE
235
+ }, {
236
+ name: 'Component - Pass traffic to blocklet component',
237
+ value: _constant.ROUTING_RULE_TYPES.COMPONENT
126
238
  }],
127
239
  setParams: () => {},
128
240
  setError: () => {}
@@ -73,6 +73,14 @@ function UpdateRule(_ref) {
73
73
  rule.to.url = params.url;
74
74
  rule.to.redirectCode = params.redirectCode;
75
75
  }
76
+ if (params.type === _constant.ROUTING_RULE_TYPES.COMPONENT) {
77
+ rule.to.did = teamDid;
78
+ rule.to.componentId = params.componentId;
79
+ rule.to.pageGroup = params.pageGroup;
80
+ }
81
+ if (params.type === _constant.ROUTING_RULE_TYPES.GENERAL_REWRITE) {
82
+ rule.to.url = (0, _urlPathFriendly.default)(params.url);
83
+ }
76
84
  await api.updateRoutingRule({
77
85
  input: {
78
86
  id: siteId,
@@ -122,6 +130,9 @@ function UpdateRule(_ref) {
122
130
  if (params.type === _constant.ROUTING_RULE_TYPES.REDIRECT && !params.url) {
123
131
  disable = true;
124
132
  }
133
+ if (params.type === _constant.ROUTING_RULE_TYPES.GENERAL_REWRITE && !params.url) {
134
+ disable = true;
135
+ }
125
136
  if (!e.target.value.trim()) {
126
137
  disable = true;
127
138
  setError(t('router.validation.pathPrefixRequired'));
@@ -149,10 +160,12 @@ function UpdateRule(_ref) {
149
160
  cancel: t('router.rule.update.cancel'),
150
161
  color: 'primary',
151
162
  params: {
163
+ did: to.did || '',
152
164
  pathPrefix: name === '/' ? name : name.replace(/^\/+/, '').replace(/\/+$/, ''),
153
165
  type: to.type || _constant.ROUTING_RULE_TYPES.BLOCKLET,
154
- interfaceName: to.interfaceName || '',
155
166
  redirectCode: to.redirectCode || 302,
167
+ componentId: to.componentId || '',
168
+ pageGroup: to.pageGroup || '',
156
169
  url: to.url || '',
157
170
  __disableConfirm: false
158
171
  },
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = RuleListWithPermission;
7
+ var _react = _interopRequireDefault(require("react"));
7
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
8
9
  var _isUrl = _interopRequireDefault(require("is-url"));
9
10
  var _useTheme = _interopRequireDefault(require("@mui/material/styles/useTheme"));
@@ -15,12 +16,14 @@ var _Avatar = _interopRequireDefault(require("@mui/material/Avatar"));
15
16
  var _LockIcon = _interopRequireDefault(require("@arcblock/icons/lib/LockIcon"));
16
17
  var _context = require("@arcblock/ux/lib/Locale/context");
17
18
  var _constant = require("@abtnode/constant");
18
- var _util = require("../../util");
19
+ var _util = require("@blocklet/meta/lib/util");
20
+ var _util2 = require("../../util");
19
21
  var _blocklet = require("../../contexts/blocklet");
20
22
  var _node = require("../../contexts/node");
21
23
  var _permission = require("../../permission");
22
24
  var _line = _interopRequireDefault(require("../component/line"));
23
25
  var _ruleActions = _interopRequireDefault(require("./rule-actions"));
26
+ var _pageGroup = _interopRequireDefault(require("../page-group"));
24
27
  var _jsxRuntime = require("react/jsx-runtime");
25
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26
29
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -70,31 +73,39 @@ function RuleList(_ref2) {
70
73
  blocklet,
71
74
  recommendedDomain: domain
72
75
  } = (0, _blocklet.useBlockletContext)();
73
- const rules = blocklet.site.rules.filter(rule => rule.to.did !== blocklet.meta.did).filter(rule => rule.to.type !== _constant.ROUTING_RULE_TYPES.BLOCKLET);
76
+ const rules = blocklet.site.rules.filter(rule => rule.to.type !== _constant.ROUTING_RULE_TYPES.BLOCKLET);
74
77
  return rules.map(rule => {
75
- let avatarName = '';
78
+ let avatar = null;
79
+ let component = null;
76
80
  if (rule.to.type === _constant.ROUTING_RULE_TYPES.NONE) {
77
- avatarName = '404';
81
+ avatar = '404';
78
82
  } else if (rule.to.type === _constant.ROUTING_RULE_TYPES.REDIRECT) {
79
- avatarName = rule.to.redirectCode;
83
+ avatar = rule.to.redirectCode;
84
+ } else if (rule.to.type === _constant.ROUTING_RULE_TYPES.GENERAL_REWRITE) {
85
+ avatar = 'R';
86
+ } else if (rule.to.type === _constant.ROUTING_RULE_TYPES.COMPONENT) {
87
+ component = blocklet.children.find(x => x.meta.did === rule.to.componentId);
88
+ avatar = 'C';
80
89
  }
81
90
  const action = rule.isProtected ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
82
91
  title: t('blocklet.router.urlLockTooltip'),
83
92
  placement: "top",
84
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
85
- disabled: true,
86
- size: "small",
87
- style: {
88
- pointerEvents: 'auto',
89
- // padding replace to margin, fix the tooltip position
90
- paddingTop: 0,
91
- paddingBottom: 0,
92
- margin: '12px 0'
93
- },
94
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LockIcon.default, {
93
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
94
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
95
+ disabled: true,
96
+ size: "small",
95
97
  style: {
96
- fill: theme.palette.text.disabled
97
- }
98
+ pointerEvents: 'auto',
99
+ // padding replace to margin, fix the tooltip position
100
+ paddingTop: 0,
101
+ paddingBottom: 0,
102
+ margin: '12px 0'
103
+ },
104
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LockIcon.default, {
105
+ style: {
106
+ fill: theme.palette.text.disabled
107
+ }
108
+ })
98
109
  })
99
110
  })
100
111
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ruleActions.default, _objectSpread({}, rule));
@@ -113,23 +124,28 @@ function RuleList(_ref2) {
113
124
  alignItems: "center",
114
125
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
115
126
  width: 28
116
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
117
- children: avatarName
127
+ }), typeof avatar === 'object' ? avatar : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
128
+ children: avatar
118
129
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
119
- ml: "16px",
130
+ ml: 2,
120
131
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
121
132
  style: {
122
133
  color: '#222',
123
- fontSize: 18
134
+ fontSize: 16
124
135
  },
125
- children: [rule.to.type === _constant.ROUTING_RULE_TYPES.NONE && t('common.page404'), rule.to.type === _constant.ROUTING_RULE_TYPES.REDIRECT && t('common.redirect')]
126
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
136
+ children: [rule.to.type === _constant.ROUTING_RULE_TYPES.NONE && t('common.page404'), rule.to.type === _constant.ROUTING_RULE_TYPES.REDIRECT && t('common.redirect'), rule.to.type === _constant.ROUTING_RULE_TYPES.GENERAL_REWRITE && t('common.rewrite'), rule.to.type === _constant.ROUTING_RULE_TYPES.COMPONENT && (0, _util.getDisplayName)(component, true)]
137
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
127
138
  display: "flex",
128
139
  alignItems: "center",
129
- children: rule.to.type === _constant.ROUTING_RULE_TYPES.REDIRECT && /*#__PURE__*/(0, _jsxRuntime.jsx)(RedirectRule, {
140
+ children: [rule.to.type === _constant.ROUTING_RULE_TYPES.REDIRECT && /*#__PURE__*/(0, _jsxRuntime.jsx)(RedirectRule, {
141
+ domain: domain,
142
+ toUrl: rule.to.url
143
+ }), rule.to.type === _constant.ROUTING_RULE_TYPES.GENERAL_REWRITE && /*#__PURE__*/(0, _jsxRuntime.jsx)(RedirectRule, {
130
144
  domain: domain,
131
145
  toUrl: rule.to.url
132
- })
146
+ }), rule.to.type === _constant.ROUTING_RULE_TYPES.COMPONENT && /*#__PURE__*/(0, _jsxRuntime.jsx)(_pageGroup.default, {
147
+ group: rule.to.pageGroup
148
+ })]
133
149
  })]
134
150
  })]
135
151
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
@@ -143,10 +159,10 @@ function RuleList(_ref2) {
143
159
  alignItems: "center",
144
160
  flexGrow: "1",
145
161
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Link.default, {
146
- href: (0, _util.getAccessUrl)(domain, rule.from.pathPrefix, (0, _util.getBlockletUrlParams)(blocklet, locale)),
162
+ href: (0, _util2.getAccessUrl)(domain, rule.from.pathPrefix, (0, _util2.getBlockletUrlParams)(blocklet, locale)),
147
163
  target: "_blank",
148
164
  style: {
149
- fontSize: 18
165
+ fontSize: 16
150
166
  },
151
167
  underline: "hover",
152
168
  children: rule.from.pathPrefix
@@ -159,7 +175,7 @@ function RuleList(_ref2) {
159
175
  children: action
160
176
  })
161
177
  }, "actions")]
162
- }, "group-not-gateway-box"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_line.default, {})];
178
+ }, "rule"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_line.default, {}, "divider")];
163
179
  });
164
180
  }
165
181
  RuleList.propTypes = {
@@ -169,7 +185,7 @@ RuleList.defaultProps = {
169
185
  hasPermission: false
170
186
  };
171
187
  const RuleListInDaemon = (0, _permission.withPermission)(RuleList, 'mutate_blocklets');
172
- const RuleListInService = (0, _permission.withPermission)(RuleList, '', _util.BlockletAdminRoles);
188
+ const RuleListInService = (0, _permission.withPermission)(RuleList, '', _util2.BlockletAdminRoles);
173
189
  function RuleListWithPermission(props) {
174
190
  const {
175
191
  inService
@@ -28,7 +28,7 @@ const _excluded = ["spaceGateways", "refreshSpaceGateways"];
28
28
  /**
29
29
  * @description
30
30
  * @param {{
31
- * spaceGateways: Array<import('./connected').SpaceGateway>,
31
+ * spaceGateways?: Array<import('./connected').SpaceGateway>,
32
32
  * refreshSpaceGateways: () => void,
33
33
  * }} { spaceGateways, refreshSpaceGateways, ...rest }
34
34
  * @return {*}
@@ -246,10 +246,11 @@ function ConnectTo(_ref) {
246
246
  }
247
247
  };
248
248
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
249
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_SplitButton.default, _objectSpread(_objectSpread({
249
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_SplitButton.default, {
250
250
  color: "primary",
251
251
  style: {
252
- textTransform: 'none !important'
252
+ textTransform: 'none !important',
253
+ fontSize: '1rem'
253
254
  },
254
255
  size: "small",
255
256
  onClick: handleUseWalletConnect,
@@ -261,8 +262,7 @@ function ConnectTo(_ref) {
261
262
  size: "small"
262
263
  }, rest), {}, {
263
264
  children: t('storage.spaces.connect.useSpaceGateway')
264
- }), "1")]
265
- }, rest), {}, {
265
+ }), "1")],
266
266
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
267
267
  sx: {
268
268
  fontWeight: 'bold',
@@ -270,7 +270,7 @@ function ConnectTo(_ref) {
270
270
  },
271
271
  children: t('storage.spaces.connect.useWallet')
272
272
  })
273
- })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Connect.default, {
273
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Connect.default, {
274
274
  forceConnected: false,
275
275
  saveConnect: false,
276
276
  prefix: authorizeFromNftConnect.prefix,
@@ -372,8 +372,12 @@ function ConnectTo(_ref) {
372
372
  });
373
373
  }
374
374
  ConnectTo.propTypes = {
375
- spaceGateways: _propTypes.array.isRequired,
376
- refreshSpaceGateways: _propTypes.func.isRequired
375
+ spaceGateways: _propTypes.array,
376
+ refreshSpaceGateways: _propTypes.func
377
+ };
378
+ ConnectTo.defaultProps = {
379
+ spaceGateways: [],
380
+ refreshSpaceGateways: () => undefined
377
381
  };
378
382
  var _default = ConnectTo;
379
383
  exports.default = _default;
@@ -165,10 +165,6 @@ function Connected() {
165
165
  fontWeight: "bold",
166
166
  children: t('storage.spaces.connected.title')
167
167
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_connectTo.default, {
168
- style: {
169
- fontSize: '1rem'
170
- },
171
- display: "inline-flex",
172
168
  spaceGateways: spaceGateways,
173
169
  refreshSpaceGateways: refreshSpaceGateways
174
170
  })]