Skip to content

Commit 3778cd3

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into HEAD
2 parents 647e3db + 03cef69 commit 3778cd3

File tree

26 files changed

+236
-65
lines changed

26 files changed

+236
-65
lines changed

cspell.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,8 @@
359359
"Enjin",
360360
"poap",
361361
"irss",
362-
"CELO"
362+
"CELO",
363+
"flac"
363364
],
364365
"ignoreRegExpList": ["/@servie/"],
365366
"overrides": [

packages/icons/brands/MaskGrey.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { createIcon } from '../utils'
1+
import { createPaletteAwareIcon } from '../utils'
22
import type { SvgIcon } from '@mui/material'
33

4-
export const MaskGreyIcon: typeof SvgIcon = createIcon(
4+
export const MaskGreyIcon: typeof SvgIcon = createPaletteAwareIcon(
55
'Mask',
66
<g>
77
<path fill="#8796AF" d="M60 120A60 60 0 1060 0a60 60 0 000 120z" />
@@ -12,6 +12,15 @@ export const MaskGreyIcon: typeof SvgIcon = createIcon(
1212
clipRule="evenodd"
1313
/>
1414
</g>,
15+
<g>
16+
<path d="M18 36c9.941 0 18-8.059 18-18S27.941 0 18 0 0 8.059 0 18s8.059 18 18 18Z" fill="#2F3336" />
17+
<path
18+
fillRule="evenodd"
19+
clipRule="evenodd"
20+
d="M28.864 13.575v5.978H9.86c.83 3.627 4.123 6.336 8.058 6.336a8.273 8.273 0 0 0 7.415-4.543h3.531v5.021c0 1.189-.979 2.152-2.186 2.152H9.186C7.98 28.52 7 27.556 7 26.367V13.575h21.864Zm-5.628 7.771a6.46 6.46 0 0 1-5.318 2.764 6.46 6.46 0 0 1-5.317-2.764h10.635Zm-9.98-6.336c-1.714 0-3.131 1.247-3.367 2.87h1.864c.205-.625.8-1.077 1.503-1.077.702 0 1.298.452 1.503 1.076h1.863c-.235-1.622-1.653-2.869-3.366-2.869Zm9.353 0c-1.714 0-3.131 1.247-3.367 2.87h1.864c.205-.625.8-1.077 1.503-1.077.702 0 1.298.452 1.503 1.076h1.863c-.235-1.622-1.653-2.869-3.366-2.869ZM26.678 7c1.207 0 2.186.963 2.186 2.152v2.63H7v-2.63C7 7.963 7.979 7 9.186 7h17.492Z"
21+
fill="#15171A"
22+
/>
23+
</g>,
1524
'0 0 120 120',
1625
[130, 40],
1726
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { createIcon } from '../utils'
2+
3+
export const AssetLoadingIcon = createIcon(
4+
'AssetLoadingIcon',
5+
<g fill="none">
6+
<path d="M18 36c9.941 0 18-8.059 18-18S27.941 0 18 0 0 8.059 0 18s8.059 18 18 18Z" fill="#1C68F3" />
7+
<path
8+
fillRule="evenodd"
9+
clipRule="evenodd"
10+
d="M28.864 13.575v5.978H9.86c.83 3.627 4.123 6.336 8.058 6.336a8.273 8.273 0 0 0 7.415-4.543h3.531v5.021c0 1.189-.979 2.152-2.186 2.152H9.186C7.98 28.52 7 27.556 7 26.367V13.575h21.864Zm-5.628 7.771a6.46 6.46 0 0 1-5.318 2.764 6.46 6.46 0 0 1-5.317-2.764h10.635Zm-9.98-6.336c-1.714 0-3.131 1.247-3.367 2.87h1.864c.205-.625.8-1.077 1.503-1.077.702 0 1.298.452 1.503 1.076h1.863c-.235-1.622-1.653-2.869-3.366-2.869Zm9.353 0c-1.714 0-3.131 1.247-3.367 2.87h1.864c.205-.625.8-1.077 1.503-1.077.702 0 1.298.452 1.503 1.076h1.863c-.235-1.622-1.653-2.869-3.366-2.869ZM26.678 7c1.207 0 2.186.963 2.186 2.152v2.63H7v-2.63C7 7.963 7.979 7 9.186 7h17.492Z"
11+
fill="#fff"
12+
/>
13+
<ellipse cx="18" cy="48" rx="11.5" ry="4" fill="#003EAE" />
14+
</g>,
15+
'0 0 36 52',
16+
)

packages/icons/general/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,4 @@ export * from './Retweet'
8181
export * from './Drop'
8282
export * from './Right'
8383
export * from './Tutorial'
84+
export * from './AssetLoading'

packages/mask/shared-ui/locales/qya-AA.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -982,17 +982,5 @@
982982
"nft_button_add_collectible": "crwdns9209:0crwdne9209:0",
983983
"nft_avatar": "crwdns9211:0crwdne9211:0",
984984
"plugin_profile_no_wallets": "crwdns9327:0crwdne9327:0",
985-
"plugin_profile_binding_rules_title": "crwdns10417:0crwdne10417:0",
986-
"plugin_profile_binding_rule1": "crwdns10419:0crwdne10419:0",
987-
"plugin_profile_binding_rule2": "crwdns10421:0crwdne10421:0",
988-
"plugin_profile_binding_rule3": "crwdns10423:0crwdne10423:0",
989-
"plugin_profile_binding_rule4": "crwdns10425:0crwdne10425:0",
990-
"plugin_profile_current_display_of": "crwdns10427:0{{type}}crwdne10427:0",
991-
"plugin_profile_loading": "crwdns10669:0crwdne10669:0",
992-
"plugin_profile_address_name_ens": "crwdns10673:0crwdne10673:0",
993-
"plugin_profile_address_name_uns": "crwdns10675:0crwdne10675:0",
994-
"plugin_profile_address_name_dns": "crwdns10677:0crwdne10677:0",
995-
"plugin_profile_address_name_rns": "crwdns10679:0crwdne10679:0",
996-
"plugin_profile_address_name_address": "crwdns10681:0crwdne10681:0",
997985
"plugin_vcent_last_offer_at": "crwdns10295:0crwdne10295:0"
998986
}

packages/mask/shared-ui/locales/zh-CN.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -869,15 +869,5 @@
869869
"nft_button_add_collectible": "添加收藏品",
870870
"nft_avatar": "NFT 头像",
871871
"plugin_profile_no_wallets": "在此连接您的钱包。<br/>此部分将显示给您的加密朋友。<br/>显示内容包括数字艺术、捐赠、徽章<br/>和其他链上的公开信息。",
872-
"plugin_profile_binding_rules_title": "Web3 按如下规则展示NFTs:",
873-
"plugin_profile_binding_rule1": "您的Twitter 昵称为ENS。",
874-
"plugin_profile_binding_rule2": "您的Twitter bio 包含 ENS(例如,vitalik.eth) 或有效地址。",
875-
"plugin_profile_binding_rule3": "您的Twitter ID + {{suffix}} 是ENS。",
876-
"plugin_profile_binding_rule4": "用于签署NFT 头像的地址。",
877-
"plugin_profile_current_display_of": "当前显示 {{type}}: ",
878-
"plugin_profile_loading": "加载中...",
879-
"plugin_profile_error_no_address": "找不到任何有效地址。",
880-
"plugin_profile_address_name_address": "钱包地址",
881-
"plugin_profile_rss3_attended": "已参加",
882872
"plugin_vcent_last_offer_at": "最新的OFFER为"
883873
}
Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import type { FC } from 'react'
2-
import { Link } from '@mui/material'
31
import { makeStyles } from '@masknet/theme'
4-
import { Video } from '../../../components/shared/Video'
52
import { CollectibleTab } from './CollectibleTab'
63
import { CollectibleState } from '../hooks/useCollectibleState'
4+
import { AssetPlayer } from '@masknet/shared'
5+
import { useMemo } from 'react'
76

87
const useStyles = makeStyles()({
98
body: {
@@ -15,44 +14,38 @@ const useStyles = makeStyles()({
1514
maxHeight: '100%',
1615
border: 'none',
1716
},
17+
errorPlaceholder: {
18+
padding: '82px 0',
19+
},
20+
loadingPlaceholder: {
21+
padding: '74px 0',
22+
},
1823
})
1924

20-
interface AssetPlayerProps {
21-
src?: string
22-
alt: string
23-
}
24-
25-
// opensea supports: JPG, PNG, GIF, SVG, MP4, WEBM, MP3, WAV, OGG, GLB, GLTF.
26-
const AssetPlayer: FC<AssetPlayerProps> = ({ src, alt }) => {
27-
const { classes } = useStyles()
28-
if (!src) return null
29-
const isVideo = src.match(/\.(mp4|webm)$/i)
30-
return isVideo ? (
31-
<Video src={src} VideoProps={{ className: classes.player }} />
32-
) : (
33-
<img className={classes.player} src={src} alt={alt} />
34-
)
35-
}
36-
3725
export interface ArticleTabProps {}
3826

3927
export function ArticleTab(props: ArticleTabProps) {
4028
const { classes } = useStyles()
4129
const { asset } = CollectibleState.useContainer()
4230

43-
if (!asset.value) return null
44-
const resourceUrl = asset.value.image_url || asset.value.animation_url
45-
return (
46-
<CollectibleTab>
47-
<div className={classes.body}>
48-
{asset.value.animation_url ? (
49-
<Link href={asset.value.animation_url} target="_blank" rel="noopener noreferrer">
50-
<AssetPlayer src={resourceUrl} alt={asset.value?.name ?? ''} />
51-
</Link>
52-
) : (
53-
<AssetPlayer src={resourceUrl} alt={asset.value?.name ?? ''} />
54-
)}
55-
</div>
56-
</CollectibleTab>
57-
)
31+
return useMemo(() => {
32+
if (!asset.value) return null
33+
const resourceUrl = asset.value.animation_url || asset.value.image_url
34+
return (
35+
<CollectibleTab>
36+
<div className={classes.body}>
37+
<AssetPlayer
38+
url={resourceUrl}
39+
options={{
40+
playsInline: true,
41+
}}
42+
classes={{
43+
errorPlaceholder: classes.errorPlaceholder,
44+
loadingPlaceholder: classes.loadingPlaceholder,
45+
}}
46+
/>
47+
</div>
48+
</CollectibleTab>
49+
)
50+
}, [asset.value?.animation_url, asset.value?.image_url, classes])
5851
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)