@arcblock/ux 2.10.33 → 2.10.35

Sign up to get free protection for your applications and to get access to all the features.
@@ -79,7 +79,7 @@ Badge.defaultProps = {
79
79
  className: '',
80
80
  style: '{}'
81
81
  };
82
- export default withDeprecated( /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/_jsx(Badge, {
82
+ export default withDeprecated(/*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/_jsx(Badge, {
83
83
  ...props,
84
84
  forwardedRef: ref
85
85
  })), {
@@ -135,7 +135,7 @@ export default function CustomToolbar(props) {
135
135
  // Large screens show the toolbar buttons directly, small screens show the drop-down menu style buttons
136
136
  // The right-hand button of the form toolbar in desktop mode
137
137
  const toolbarButtons = [...defaultButtons, ...customButtons].map((e, index) => {
138
- if ( /*#__PURE__*/isValidElement(e)) {
138
+ if (/*#__PURE__*/isValidElement(e)) {
139
139
  return e;
140
140
  }
141
141
  const popId = getPopId(index);
@@ -146,7 +146,7 @@ export default function CustomToolbar(props) {
146
146
  } = e;
147
147
  // When popRender is present, clicking the button will bubble up the content returned by the popRender
148
148
  if (popRender) {
149
- allPops.push( /*#__PURE__*/_jsx(Popover, {
149
+ allPops.push(/*#__PURE__*/_jsx(Popover, {
150
150
  open: !!allPopsEl[popId],
151
151
  anchorEl: () => allPopsEl[popId],
152
152
  onClose: () => {
@@ -192,7 +192,7 @@ export default function CustomToolbar(props) {
192
192
  const menuItems = [...defaultButtons, ...customButtons].map((e, index) => {
193
193
  const popId = getPopId(index);
194
194
  let content;
195
- if ( /*#__PURE__*/isValidElement(e)) {
195
+ if (/*#__PURE__*/isValidElement(e)) {
196
196
  content = e;
197
197
  } else if (e.icon) {
198
198
  const {
@@ -278,7 +278,7 @@ function ReDataTable({
278
278
  emptyEl = /*#__PURE__*/_jsx(CircularProgress, {
279
279
  color: "primary"
280
280
  });
281
- } else if ( /*#__PURE__*/isValidElement(emptyNode)) {
281
+ } else if (/*#__PURE__*/isValidElement(emptyNode)) {
282
282
  emptyEl = emptyNode;
283
283
  } else if (locale === 'zh') {
284
284
  emptyEl = /*#__PURE__*/_jsx(Empty, {
package/lib/Icon/index.js CHANGED
@@ -75,7 +75,7 @@ const Span = styled('span')`
75
75
  line-height: ${props => props.size}px;
76
76
  }
77
77
  `;
78
- export default withDeprecated( /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/_jsx(Icon, {
78
+ export default withDeprecated(/*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/_jsx(Icon, {
79
79
  ...props,
80
80
  forwardedRef: ref
81
81
  })), {
@@ -306,7 +306,7 @@ function NFTDisplay({
306
306
  }
307
307
  throw new Error(`unsupported display protocol: ${display.type}`);
308
308
  };
309
- return wrapRoot( /*#__PURE__*/_jsxs(_Fragment, {
309
+ return wrapRoot(/*#__PURE__*/_jsxs(_Fragment, {
310
310
  children: [(state.loading || !minimumLoadingReady) && (renderLoading ? renderLoading() : /*#__PURE__*/_jsx(DefaultLoading, {})), renderNFT()]
311
311
  }));
312
312
  } catch (e) {
@@ -88,7 +88,7 @@ function PageScroller({
88
88
  let i = 0;
89
89
  while (i < componentsToRenderLength && !isNil(children[i])) {
90
90
  containers[i] = true;
91
- newComponentsToRender.push( /*#__PURE__*/_jsx("div", {
91
+ newComponentsToRender.push(/*#__PURE__*/_jsx("div", {
92
92
  style: {
93
93
  height: '100%',
94
94
  width: '100%'
@@ -13,7 +13,7 @@ export default function FullPage() {
13
13
  const [current, setCurrent] = useState(0);
14
14
  const pageNumbers = [];
15
15
  for (let i = 0; i < 5; i++) {
16
- pageNumbers.push( /*#__PURE__*/_jsx(Button, {
16
+ pageNumbers.push(/*#__PURE__*/_jsx(Button, {
17
17
  variant: i === current ? 'contained' : 'outlined',
18
18
  size: "small",
19
19
  onClick: () => setCurrent(i),
@@ -13,7 +13,7 @@ export default function FullPage() {
13
13
  const [current, setCurrent] = useState(0);
14
14
  const pageNumbers = [];
15
15
  for (let i = 0; i < 5; i++) {
16
- pageNumbers.push( /*#__PURE__*/_jsx(Button, {
16
+ pageNumbers.push(/*#__PURE__*/_jsx(Button, {
17
17
  variant: i === current ? 'contained' : 'outlined',
18
18
  size: "small",
19
19
  onClick: () => setCurrent(i),
@@ -4,6 +4,7 @@ import upperFirst from 'lodash/upperFirst';
4
4
  import { Box } from '@mui/material';
5
5
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
6
6
  import RevokeIcon from '@arcblock/icons/lib/RevokeIcon';
7
+ import NFTDisplay from '../NFTDisplay';
7
8
  export default function Passport({
8
9
  passport,
9
10
  user,
@@ -24,13 +25,26 @@ export default function Passport({
24
25
  alignItems: 'center',
25
26
  ...rest?.sx
26
27
  },
27
- children: [/*#__PURE__*/_jsx(Box, {
28
+ children: [!!passport.display && /*#__PURE__*/_jsx(Box, {
29
+ className: "passport-item__display",
30
+ sx: {
31
+ width
32
+ },
33
+ children: /*#__PURE__*/_jsx(NFTDisplay, {
34
+ address: passport.id,
35
+ data: passport.display,
36
+ imageFilter: typeof width === 'number' ? {
37
+ imageFilter: 'resize',
38
+ w: width
39
+ } : null
40
+ })
41
+ }), !passport.display && /*#__PURE__*/_jsx(Box, {
28
42
  className: "passport-item__display"
29
43
  // eslint-disable-next-line react/no-danger
30
44
  ,
31
45
  dangerouslySetInnerHTML: {
32
46
  __html: createPassportSvg({
33
- title: passport.scope === 'passport' ? passport.title : passport.name,
47
+ title: passport.scope === 'kyc' ? passport.name : passport.title,
34
48
  issuer: passport.issuer && passport.issuer.name,
35
49
  issuerDid: passport.issuer && passport.issuer.id,
36
50
  ownerName: user.fullName,
@@ -39,6 +53,7 @@ export default function Passport({
39
53
  revoked: passport.revoked,
40
54
  scope: passport.scope,
41
55
  role: passport.role,
56
+ display: passport.display,
42
57
  preferredColor: color,
43
58
  width
44
59
  })
@@ -5,7 +5,7 @@ import * as Sentry from '@sentry/browser';
5
5
  import { useMount, useDeepCompareEffect } from 'ahooks';
6
6
  import { useLocation } from 'react-router-dom';
7
7
  import ErrorBoundary from './error_boundary';
8
- export default ((WrappedComponent, options = {}) => {
8
+ export default (WrappedComponent, options = {}) => {
9
9
  const {
10
10
  appVersion,
11
11
  gaAccount,
@@ -52,4 +52,4 @@ export default ((WrappedComponent, options = {}) => {
52
52
  ...props
53
53
  });
54
54
  };
55
- });
55
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.10.33",
3
+ "version": "2.10.35",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -48,8 +48,8 @@
48
48
  "copyfiles": "^2.4.1",
49
49
  "eslint-plugin-react-hooks": "^4.6.0",
50
50
  "glob": "^10.3.3",
51
- "jest": "^28.1.3",
52
- "jest-environment-jsdom": "^29.5.0",
51
+ "jest": "^29.7.0",
52
+ "jest-environment-jsdom": "^29.7.0",
53
53
  "moment-timezone": "^0.5.37",
54
54
  "typescript": "^5.5.4"
55
55
  },
@@ -61,12 +61,12 @@
61
61
  "react": ">=18.2.0",
62
62
  "react-router-dom": ">=6.22.3"
63
63
  },
64
- "gitHead": "58a96227a0ce1ff3bb36b5f29ad09a4179d26020",
64
+ "gitHead": "f9b94c550f326b354ae2850e03e28947c5cdb0d1",
65
65
  "dependencies": {
66
66
  "@arcblock/did-motif": "^1.1.13",
67
- "@arcblock/icons": "^2.10.33",
68
- "@arcblock/nft-display": "^2.10.33",
69
- "@arcblock/react-hooks": "^2.10.33",
67
+ "@arcblock/icons": "^2.10.35",
68
+ "@arcblock/nft-display": "^2.10.35",
69
+ "@arcblock/react-hooks": "^2.10.35",
70
70
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
71
71
  "@fontsource/inter": "^5.0.16",
72
72
  "@fontsource/ubuntu-mono": "^5.0.18",
@@ -4,6 +4,8 @@ import { Box } from '@mui/material';
4
4
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
5
5
  import RevokeIcon from '@arcblock/icons/lib/RevokeIcon';
6
6
 
7
+ import NFTDisplay from '../NFTDisplay';
8
+
7
9
  export default function Passport({ passport, user, color, width, icon, children, createPassportSvg, ...rest }) {
8
10
  const { t } = useLocaleContext();
9
11
  return (
@@ -14,25 +16,37 @@ export default function Passport({ passport, user, color, width, icon, children,
14
16
  alignItems: 'center',
15
17
  ...rest?.sx,
16
18
  }}>
17
- <Box
18
- className="passport-item__display"
19
- // eslint-disable-next-line react/no-danger
20
- dangerouslySetInnerHTML={{
21
- __html: createPassportSvg({
22
- title: passport.scope === 'passport' ? passport.title : passport.name,
23
- issuer: passport.issuer && passport.issuer.name,
24
- issuerDid: passport.issuer && passport.issuer.id,
25
- ownerName: user.fullName,
26
- ownerDid: user.did,
27
- ownerAvatarUrl: user.avatar,
28
- revoked: passport.revoked,
29
- scope: passport.scope,
30
- role: passport.role,
31
- preferredColor: color,
32
- width,
33
- }),
34
- }}
35
- />
19
+ {!!passport.display && (
20
+ <Box className="passport-item__display" sx={{ width }}>
21
+ <NFTDisplay
22
+ address={passport.id}
23
+ data={passport.display}
24
+ imageFilter={typeof width === 'number' ? { imageFilter: 'resize', w: width } : null}
25
+ />
26
+ </Box>
27
+ )}
28
+ {!passport.display && (
29
+ <Box
30
+ className="passport-item__display"
31
+ // eslint-disable-next-line react/no-danger
32
+ dangerouslySetInnerHTML={{
33
+ __html: createPassportSvg({
34
+ title: passport.scope === 'kyc' ? passport.name : passport.title,
35
+ issuer: passport.issuer && passport.issuer.name,
36
+ issuerDid: passport.issuer && passport.issuer.id,
37
+ ownerName: user.fullName,
38
+ ownerDid: user.did,
39
+ ownerAvatarUrl: user.avatar,
40
+ revoked: passport.revoked,
41
+ scope: passport.scope,
42
+ role: passport.role,
43
+ display: passport.display,
44
+ preferredColor: color,
45
+ width,
46
+ }),
47
+ }}
48
+ />
49
+ )}
36
50
  <Box
37
51
  className="passport-item__body"
38
52
  sx={{