@arcblock/ux 2.5.62 → 2.5.64

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.
@@ -216,27 +216,31 @@ function SessionManager(_ref) {
216
216
  }
217
217
  function _onSwitchPassport() {
218
218
  const {
219
- user
219
+ user,
220
+ provider
220
221
  } = session;
221
- if (isRawWalletAccount) {
222
+ if (provider === 'auth0') {
223
+ switchOAuthPassport(user);
224
+ } else {
222
225
  setUserOpen(false);
223
226
  session.switchPassport(function () {
224
227
  setUserOpen(false);
225
228
  onSwitchPassport(...arguments);
226
229
  });
227
- } else {
228
- switchOAuthPassport(user);
229
230
  }
230
231
  }
231
232
  function _onBindWallet() {
233
+ const {
234
+ provider
235
+ } = session;
232
236
  setUserOpen(false);
233
- if (isRawWalletAccount) {
234
- bindOAuth();
235
- } else {
237
+ if (provider === 'auth0') {
236
238
  session.bindWallet(function () {
237
239
  setUserOpen(false);
238
240
  onBindWallet(...arguments);
239
241
  });
242
+ } else {
243
+ bindOAuth();
240
244
  }
241
245
  }
242
246
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
@@ -362,7 +366,7 @@ function SessionManager(_ref) {
362
366
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.SvgIcon, {
363
367
  component: _Link.default,
364
368
  className: "session-manager-menu-icon"
365
- }), isRawWalletAccount ? "".concat(translation.bind).concat(translation.thirdParty) : "".concat(translation.bind, "DID Wallet")]
369
+ }), session.provider === 'auth0' ? "".concat(translation.bind, "DID Wallet") : "".concat(translation.bind).concat(translation.thirdParty)]
366
370
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.MenuItem, {
367
371
  className: "session-manager-menu-item",
368
372
  onClick: _onLogout,
@@ -380,7 +384,7 @@ function SessionManager(_ref) {
380
384
  SessionManager.propTypes = {
381
385
  session: _propTypes.default.shape({
382
386
  federatedMaster: _propTypes.default.object,
383
- provider: _propTypes.default.oneOf(['wallet', 'federated', 'auth0']),
387
+ provider: _propTypes.default.oneOf(['wallet', 'federated', 'auth0', '']),
384
388
  user: _propTypes.default.shape({
385
389
  did: _propTypes.default.string.isRequired,
386
390
  role: _propTypes.default.string.isRequired,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.5.62",
3
+ "version": "2.5.64",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -47,11 +47,11 @@
47
47
  "peerDependencies": {
48
48
  "react": ">=18.1.0"
49
49
  },
50
- "gitHead": "c3067dee4e427fcedbe7e2d254159dd99606823c",
50
+ "gitHead": "1f4e914738a7b804045c13e36be44d2fdad032cb",
51
51
  "dependencies": {
52
52
  "@arcblock/did-motif": "^1.1.13",
53
- "@arcblock/icons": "^2.5.62",
54
- "@arcblock/react-hooks": "^2.5.62",
53
+ "@arcblock/icons": "^2.5.64",
54
+ "@arcblock/react-hooks": "^2.5.64",
55
55
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
56
56
  "@emotion/react": "^11.10.4",
57
57
  "@emotion/styled": "^11.10.4",
@@ -171,27 +171,28 @@ function SessionManager({
171
171
  });
172
172
  }
173
173
  function _onSwitchPassport() {
174
- const { user } = session;
175
- if (isRawWalletAccount) {
174
+ const { user, provider } = session;
175
+ if (provider === 'auth0') {
176
+ switchOAuthPassport(user);
177
+ } else {
176
178
  setUserOpen(false);
177
179
  session.switchPassport((...args) => {
178
180
  setUserOpen(false);
179
181
  onSwitchPassport(...args);
180
182
  });
181
- } else {
182
- switchOAuthPassport(user);
183
183
  }
184
184
  }
185
185
 
186
186
  function _onBindWallet() {
187
+ const { provider } = session;
187
188
  setUserOpen(false);
188
- if (isRawWalletAccount) {
189
- bindOAuth();
190
- } else {
189
+ if (provider === 'auth0') {
191
190
  session.bindWallet((...args) => {
192
191
  setUserOpen(false);
193
192
  onBindWallet(...args);
194
193
  });
194
+ } else {
195
+ bindOAuth();
195
196
  }
196
197
  }
197
198
 
@@ -305,7 +306,9 @@ function SessionManager({
305
306
  onClick={_onBindWallet}
306
307
  data-cy="sessionManager-bind-trigger">
307
308
  <SvgIcon component={BindWalletIcon} className="session-manager-menu-icon" />
308
- {isRawWalletAccount ? `${translation.bind}${translation.thirdParty}` : `${translation.bind}DID Wallet`}
309
+ {session.provider === 'auth0'
310
+ ? `${translation.bind}DID Wallet`
311
+ : `${translation.bind}${translation.thirdParty}`}
309
312
  </MenuItem>
310
313
  )}
311
314
 
@@ -326,7 +329,7 @@ function SessionManager({
326
329
  SessionManager.propTypes = {
327
330
  session: PropTypes.shape({
328
331
  federatedMaster: PropTypes.object,
329
- provider: PropTypes.oneOf(['wallet', 'federated', 'auth0']),
332
+ provider: PropTypes.oneOf(['wallet', 'federated', 'auth0', '']),
330
333
  user: PropTypes.shape({
331
334
  did: PropTypes.string.isRequired,
332
335
  role: PropTypes.string.isRequired,