@arcblock/ux 2.10.48 → 2.10.49
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.
- package/lib/DID/index.js +9 -9
- package/package.json +5 -5
- package/src/DID/index.tsx +11 -7
package/lib/DID/index.js
CHANGED
|
@@ -118,16 +118,16 @@ const DID = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
118
118
|
const [open, setOpen] = useState(false);
|
|
119
119
|
const isEthDid = isEthereumDid(did);
|
|
120
120
|
const didMotifInfo = isEthDid ? undefined : getDIDMotifInfo(did);
|
|
121
|
-
const getPrepend = avatarSize => [/*#__PURE__*/_jsx("span", {
|
|
121
|
+
const getPrepend = (avatarSize, keyPrefix) => [/*#__PURE__*/_jsx("span", {
|
|
122
122
|
style: {
|
|
123
123
|
flex: '0 0 auto',
|
|
124
124
|
color: getFontColor(did, didMotifInfo, isEthDid)
|
|
125
125
|
},
|
|
126
126
|
children: "DID:"
|
|
127
|
-
},
|
|
127
|
+
}, `${keyPrefix}-prefix-did-${avatarSize}`), /*#__PURE__*/_jsx("span", {
|
|
128
128
|
className: "did-address-text",
|
|
129
129
|
children: "ABT:"
|
|
130
|
-
},
|
|
130
|
+
}, `${keyPrefix}-prefix-abt-${avatarSize}`), showAvatar && /*#__PURE__*/_jsx(Avatar, {
|
|
131
131
|
src: "",
|
|
132
132
|
did: did,
|
|
133
133
|
size: getAvatarSize(didMotifInfo, isEthDid, avatarSize || 18),
|
|
@@ -139,7 +139,7 @@ const DID = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
139
139
|
},
|
|
140
140
|
blockiesPadding: false,
|
|
141
141
|
className: "did-address-avatar"
|
|
142
|
-
},
|
|
142
|
+
}, `${keyPrefix}-avatar-${avatarSize}`)];
|
|
143
143
|
const closeQrCode = useMemoizedFn(() => {
|
|
144
144
|
setOpen(false);
|
|
145
145
|
});
|
|
@@ -188,7 +188,7 @@ const DID = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
188
188
|
content: `${DID_PREFIX}${did}`,
|
|
189
189
|
...rest,
|
|
190
190
|
ref: addressRef,
|
|
191
|
-
prepend: getPrepend(rest.size),
|
|
191
|
+
prepend: getPrepend(rest.size, 'address'),
|
|
192
192
|
append: /*#__PURE__*/_jsxs(_Fragment, {
|
|
193
193
|
children: [showQrcode ? /*#__PURE__*/_jsx(Box, {
|
|
194
194
|
id: "did-qrcode-button",
|
|
@@ -198,13 +198,13 @@ const DID = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
198
198
|
sx: {
|
|
199
199
|
flexShrink: 0,
|
|
200
200
|
cursor: 'pointer',
|
|
201
|
-
ml:
|
|
201
|
+
ml: 0.5,
|
|
202
202
|
color: 'grey.500'
|
|
203
203
|
}
|
|
204
204
|
}) : null, rest.append]
|
|
205
205
|
}),
|
|
206
206
|
children: did
|
|
207
|
-
}), /*#__PURE__*/_jsx(Dialog, {
|
|
207
|
+
}, "address"), /*#__PURE__*/_jsx(Dialog, {
|
|
208
208
|
open: open,
|
|
209
209
|
onClose: closeQrCode,
|
|
210
210
|
maxWidth: "sm",
|
|
@@ -243,12 +243,12 @@ const DID = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
243
243
|
children: /*#__PURE__*/_jsx(Address, {
|
|
244
244
|
locale: locale,
|
|
245
245
|
content: `${DID_PREFIX}${did}`,
|
|
246
|
-
prepend: getPrepend(16),
|
|
246
|
+
prepend: getPrepend(16, 'dialog'),
|
|
247
247
|
...rest,
|
|
248
248
|
size: 16,
|
|
249
249
|
copyable: true,
|
|
250
250
|
children: did
|
|
251
|
-
})
|
|
251
|
+
}, "dialog-address")
|
|
252
252
|
}), /*#__PURE__*/_jsx(Typography, {
|
|
253
253
|
variant: "body2",
|
|
254
254
|
sx: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.49",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"react": ">=18.2.0",
|
|
65
65
|
"react-router-dom": ">=6.22.3"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "206b3e502e292b9ad87f8f9d47efd7d5dc49ac28",
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@arcblock/did-motif": "^1.1.13",
|
|
70
|
-
"@arcblock/icons": "^2.10.
|
|
71
|
-
"@arcblock/nft-display": "^2.10.
|
|
72
|
-
"@arcblock/react-hooks": "^2.10.
|
|
70
|
+
"@arcblock/icons": "^2.10.49",
|
|
71
|
+
"@arcblock/nft-display": "^2.10.49",
|
|
72
|
+
"@arcblock/react-hooks": "^2.10.49",
|
|
73
73
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
74
74
|
"@fontsource/inter": "^5.0.16",
|
|
75
75
|
"@fontsource/ubuntu-mono": "^5.0.18",
|
package/src/DID/index.tsx
CHANGED
|
@@ -158,16 +158,18 @@ const DID = forwardRef<HTMLDIDElement, IDIDPropTypes>((props, ref) => {
|
|
|
158
158
|
const isEthDid = isEthereumDid(did);
|
|
159
159
|
const didMotifInfo = isEthDid ? undefined : getDIDMotifInfo(did);
|
|
160
160
|
|
|
161
|
-
const getPrepend = (avatarSize: number) => [
|
|
162
|
-
<span
|
|
161
|
+
const getPrepend = (avatarSize: number, keyPrefix: string) => [
|
|
162
|
+
<span
|
|
163
|
+
key={`${keyPrefix}-prefix-did-${avatarSize}`}
|
|
164
|
+
style={{ flex: '0 0 auto', color: getFontColor(did, didMotifInfo, isEthDid) }}>
|
|
163
165
|
DID:
|
|
164
166
|
</span>,
|
|
165
|
-
<span key=
|
|
167
|
+
<span key={`${keyPrefix}-prefix-abt-${avatarSize}`} className="did-address-text">
|
|
166
168
|
ABT:
|
|
167
169
|
</span>,
|
|
168
170
|
showAvatar && (
|
|
169
171
|
<Avatar
|
|
170
|
-
key=
|
|
172
|
+
key={`${keyPrefix}-avatar-${avatarSize}`}
|
|
171
173
|
src=""
|
|
172
174
|
did={did}
|
|
173
175
|
size={getAvatarSize(didMotifInfo, isEthDid, avatarSize || 18)}
|
|
@@ -232,11 +234,12 @@ const DID = forwardRef<HTMLDIDElement, IDIDPropTypes>((props, ref) => {
|
|
|
232
234
|
return (
|
|
233
235
|
<>
|
|
234
236
|
<Address
|
|
237
|
+
key="address"
|
|
235
238
|
locale={locale}
|
|
236
239
|
content={`${DID_PREFIX}${did}`}
|
|
237
240
|
{...rest}
|
|
238
241
|
ref={addressRef}
|
|
239
|
-
prepend={getPrepend(rest.size)}
|
|
242
|
+
prepend={getPrepend(rest.size, 'address')}
|
|
240
243
|
append={
|
|
241
244
|
<>
|
|
242
245
|
{showQrcode ? (
|
|
@@ -248,7 +251,7 @@ const DID = forwardRef<HTMLDIDElement, IDIDPropTypes>((props, ref) => {
|
|
|
248
251
|
sx={{
|
|
249
252
|
flexShrink: 0,
|
|
250
253
|
cursor: 'pointer',
|
|
251
|
-
ml:
|
|
254
|
+
ml: 0.5,
|
|
252
255
|
color: 'grey.500',
|
|
253
256
|
}}
|
|
254
257
|
/>
|
|
@@ -285,9 +288,10 @@ const DID = forwardRef<HTMLDIDElement, IDIDPropTypes>((props, ref) => {
|
|
|
285
288
|
/>
|
|
286
289
|
<Box sx={{ mt: 1.5, textAlign: 'center' }}>
|
|
287
290
|
<Address
|
|
291
|
+
key="dialog-address"
|
|
288
292
|
locale={locale}
|
|
289
293
|
content={`${DID_PREFIX}${did}`}
|
|
290
|
-
prepend={getPrepend(16)}
|
|
294
|
+
prepend={getPrepend(16, 'dialog')}
|
|
291
295
|
{...rest}
|
|
292
296
|
size={16}
|
|
293
297
|
copyable>
|