@arcblock/did-connect-react 3.3.1 → 3.3.3

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.
@@ -7,7 +7,7 @@ import noop from 'lodash/noop';
7
7
  import omit from 'lodash/omit';
8
8
  import { useImperativeHandle } from 'react';
9
9
  import ProviderIcon from '@arcblock/ux/lib/DIDConnect/provider-icon';
10
- import { LOGIN_PROVIDER } from '@arcblock/ux/lib/Util/constant';
10
+ import { LOGIN_PROVIDER, LOGIN_PROVIDER_ICON_SIZE } from '@arcblock/ux/lib/Util/constant';
11
11
 
12
12
  import LoginMethodItem from './login-method-item';
13
13
  import { useStateContext } from '../../contexts/state';
@@ -116,7 +116,7 @@ export default function WebLoginItem({
116
116
  currentState.loading || !tokenState.url ? (
117
117
  <CircularProgress
118
118
  color="primary"
119
- size={24}
119
+ size={LOGIN_PROVIDER_ICON_SIZE}
120
120
  sx={{
121
121
  '& svg': {
122
122
  transform: 'scale(0.75)',
@@ -125,12 +125,12 @@ export default function WebLoginItem({
125
125
  />
126
126
  ) : (
127
127
  <ProviderIcon
128
- width="24px"
129
- height="24px"
130
- provider={LOGIN_PROVIDER.DID_WALLET}
131
- style={{
128
+ sx={{
129
+ width: LOGIN_PROVIDER_ICON_SIZE,
130
+ height: LOGIN_PROVIDER_ICON_SIZE,
132
131
  transform: 'scale(0.9)',
133
132
  }}
133
+ provider={LOGIN_PROVIDER.DID_WALLET}
134
134
  />
135
135
  )
136
136
  }
@@ -482,9 +482,9 @@ function Connect({
482
482
  mode === 'drawer' ? '100%' : hideQRCode || showStatus ? DID_CONNECT_SMALL_WIDTH : DID_CONNECT_MEDIUM_WIDTH,
483
483
  transition: 'width 0.2s ease-in-out',
484
484
  margin: 'auto',
485
- p: isSmallView ? 2 : 3,
485
+ p: 3,
486
486
  pb: 0,
487
- gap: 2,
487
+ gap: 2.5,
488
488
  }}>
489
489
  <Box data-did-auth-url={state.url} sx={{ display: 'none' }} />
490
490
  <DIDConnectTitle
@@ -1,6 +1,6 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import { useMemoizedFn } from 'ahooks';
3
- import mailOutlineRoundedIcon from '@iconify-icons/material-symbols/mail-outline-rounded';
3
+ import mailFilledIcon from '@iconify-icons/tabler/mail-filled';
4
4
  import { LOGIN_PROVIDER, LOGIN_PROVIDER_NAME } from '@arcblock/ux/lib/Util/constant';
5
5
  import { GA_LAST_LOGIN_METHOD } from '@arcblock/ux/lib/withTracker/constant';
6
6
 
@@ -22,7 +22,7 @@ export default function EmailListItem({ ...rest }) {
22
22
  <LoginMethodItem
23
23
  {...rest}
24
24
  title={LOGIN_PROVIDER_NAME[LOGIN_PROVIDER.EMAIL]}
25
- icon={mailOutlineRoundedIcon}
25
+ icon={mailFilledIcon}
26
26
  onClick={handleConnect}
27
27
  />
28
28
  );
@@ -184,7 +184,7 @@ function OAuthProvider({
184
184
  try {
185
185
  const data = await runPopup({
186
186
  popup,
187
- closeTimeout: 0,
187
+ closeTimeout: 1500,
188
188
  });
189
189
  if (data?.response) {
190
190
  return data.response?.code;
package/src/utils.js CHANGED
@@ -370,9 +370,9 @@ export const runPopup = (config) => {
370
370
  clearTimeout(timeoutId);
371
371
  clearInterval(popupTimer);
372
372
  window.removeEventListener('message', popupEventListener, false);
373
-
374
- resolve(data);
375
373
  }, config.closeTimeout || 0);
374
+ // 不用等弹窗关闭,可以直接返回结果
375
+ resolve(data);
376
376
  };
377
377
 
378
378
  timeoutId = setTimeout(