Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/mask/shared-ui/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"unknown": "Unknown",
"message": "Message",
"dashboard_tab_collectibles": "Collectibles",
"dashboard_no_collectible_found": "No collectible found",
"dashboard_no_collectible_found": "No collectible found.",
"days": "Every {{days}} days",
"decrypted_postbox_add_recipients": "Append recipients",
"decrypted_postbox_decrypting": "Mask decrypting…",
Expand Down Expand Up @@ -1004,11 +1004,11 @@
"nft_button_add_collectible": "Add Collectible",
"nft_avatar": "NFT Avatar",
"plugin_profile_no_wallets": "Connect your wallet here.<br/>This section will be shown to your encrypted friends.<br/>The display content includes digital art, donations, badges<br/>and other public information on chain.",
"plugin_profile_binding_rules_title": "The NFT gallary will show NFTs as below rules:",
"plugin_profile_binding_rule1": "Twitter nickname is ENS.",
"plugin_profile_binding_rule2": "Twitter bio contains ENS(e.g. vitalik.eth) or valid address.",
"plugin_profile_binding_rule3": "Twitter ID + {{suffix}} is ENS.",
"plugin_profile_binding_rule4": "Address used to sign the avatar.",
"plugin_profile_binding_rules_title": "The wallet address discovery rules:",
"plugin_profile_binding_rule1": "The nickname is ENS or RNS.",
"plugin_profile_binding_rule2": "The bio contains ENS, RNS or a valid address.",
"plugin_profile_binding_rule3": "The ID + suffix is ENS or RNS.",
"plugin_profile_binding_rule4": "The address used to sign the PFP NFTs.",
"plugin_profile_current_display_of": "Current display of {{type}}: ",
"plugin_profile_loading": "Loading...",
"plugin_profile_error_no_address": "Failed to find any valid address.",
Expand Down
2 changes: 1 addition & 1 deletion packages/mask/shared-ui/locales/qya-AA.json
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@
"plugin_profile_binding_rules_title": "crwdns10417:0crwdne10417:0",
"plugin_profile_binding_rule1": "crwdns10419:0crwdne10419:0",
"plugin_profile_binding_rule2": "crwdns10421:0crwdne10421:0",
"plugin_profile_binding_rule3": "crwdns10423:0{{suffix}}crwdne10423:0",
"plugin_profile_binding_rule3": "crwdns10423:0crwdne10423:0",
"plugin_profile_binding_rule4": "crwdns10425:0crwdne10425:0",
"plugin_profile_current_display_of": "crwdns10427:0{{type}}crwdne10427:0",
"plugin_profile_loading": "crwdns10669:0crwdne10669:0",
Expand Down
10 changes: 5 additions & 5 deletions packages/mask/shared-ui/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -886,11 +886,11 @@
"nft_button_add_collectible": "添加收藏品",
"nft_avatar": "NFT 头像",
"plugin_profile_no_wallets": "在此连接您的钱包。<br/>此部分将显示给您的加密朋友。<br/>显示内容包括数字艺术、捐赠、徽章<br/>和其他链上的公开信息。",
"plugin_profile_binding_rules_title": "Web3 按如下规则展示NFTs:",
"plugin_profile_binding_rule1": "您的Twitter 昵称为ENS。",
"plugin_profile_binding_rule2": "您的Twitter bio 包含 ENS(例如,vitalik.eth) 或有效地址。",
"plugin_profile_binding_rule3": "您的Twitter ID + {{suffix}} 是ENS。",
"plugin_profile_binding_rule4": "用于签署NFT 头像的地址。",
"plugin_profile_binding_rules_title": "Web3 按如下规则发现钱包地址:",
"plugin_profile_binding_rule1": "您的昵称为 ENS 或者 RNS。",
"plugin_profile_binding_rule2": "您的个人介绍中包含 ENS、RNS 或有效地址。",
"plugin_profile_binding_rule3": "您的 ID + 词缀是 ENS 或者 RNS。",
"plugin_profile_binding_rule4": "用于签署 NFT 头像的地址。",
"plugin_profile_current_display_of": "当前显示 {{type}}: ",
"plugin_vcent_last_offer_at": "最新的OFFER为"
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ interface CollectibleListUIProps extends withClasses<'empty' | 'button' | 'text'
}
function CollectibleListUI(props: CollectibleListUIProps) {
const { provider, wallet, collectibles, loading, collectiblesRetry, error, readonly, hasRetry = true } = props
const classes = useStylesExtends(useStyles(), props)
const { t } = useI18N()
const classes = useStylesExtends(useStyles(), props)

useEffect(() => WalletMessages.events.erc721TokensUpdated.on(collectiblesRetry))

WalletMessages.events.erc721TokensUpdated.on(collectiblesRetry)
if (loading)
return (
<Box className={classes.root}>
Expand Down Expand Up @@ -171,13 +172,13 @@ function CollectibleListUI(props: CollectibleListUIProps) {
)
}

export interface CollectibleListAddressProps extends withClasses<'empty' | 'button'> {
export interface CollectibleListProps extends withClasses<'empty' | 'button'> {
address: string
collection?: string
setCount: (count: number) => void
}

export function CollectibleListAddress(props: CollectibleListAddressProps) {
export function CollectibleList(props: CollectibleListProps) {
const { address, collection, setCount } = props
const provider = useValueRef(currentNonFungibleAssetDataProviderSettings)
const chainId = ChainId.Mainnet
Expand All @@ -198,20 +199,15 @@ export function CollectibleListAddress(props: CollectibleListAddressProps) {
}, [provider, address])

useEffect(() => {
if (collectibles.length) {
setRendCollectibles([...rendCollectibles, ...collectibles])
if (hasNextPage) {
const timer = setTimeout(() => {
setPage(page + 1)
}, 1000)

return () => {
clearTimeout(timer)
}
}
if (!collectibles.length) return
setRendCollectibles([...rendCollectibles, ...collectibles])
if (!hasNextPage) return
const timer = setTimeout(() => {
setPage(page + 1)
}, 1000)
return () => {
clearTimeout(timer)
}

return () => {}
}, [collectibles])

useEffect(() => {
Expand All @@ -233,8 +229,9 @@ export function CollectibleListAddress(props: CollectibleListAddressProps) {
}

export function CollectionList({ address }: { address: string }) {
const provider = useValueRef(currentNonFungibleAssetDataProviderSettings)
const chainId = ChainId.Mainnet
const provider = useValueRef(currentNonFungibleAssetDataProviderSettings)
const { t } = useI18N()
const [page, setPage] = useState(0)
const { classes } = useStyles()
const [counts, setCounts] = useState<number[]>([])
Expand All @@ -248,22 +245,26 @@ export function CollectionList({ address }: { address: string }) {
}, [provider, address])

useEffect(() => {
if (collections.length) {
setRendCollections([...rendCollections, ...collections])
if (hasNextPage) {
const timer = setTimeout(() => {
setPage(page + 1)
}, 3000)

return () => {
clearTimeout(timer)
}
}
if (!collections.length) return
setRendCollections([...rendCollections, ...collections])
if (!hasNextPage) return
const timer = setTimeout(() => {
setPage(page + 1)
}, 3000)
return () => {
clearTimeout(timer)
}

return () => {}
}, [collections])

if (!rendCollections.length)
return (
<Box display="flex" alignItems="center" justifyContent="center">
<Typography color="textPrimary" sx={{ paddingTop: 4, paddingBottom: 4 }}>
{t('dashboard_no_collectible_found')}
</Typography>
</Box>
)

return (
<Box>
{rendCollections.map((x, i) => (
Expand All @@ -281,7 +282,7 @@ export function CollectionList({ address }: { address: string }) {
{counts[i] ? `(${counts[i]})` : null}
</Typography>
</Box>
<CollectibleListAddress
<CollectibleList
address={address}
collection={x.slug}
setCount={(count) => {
Expand Down
34 changes: 14 additions & 20 deletions packages/mask/src/plugins/Profile/SNSAdaptor/DonationsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import { makeStyles } from '@masknet/theme'
import { CircularProgress, Link } from '@mui/material'
import urlcat from 'urlcat'
import type { GeneralAssetWithTags } from '../types'
import { makeStyles } from '@masknet/theme'
import { Link } from '@mui/material'
import type { AddressName } from '@masknet/web3-shared-evm'
import type { GeneralAsset, GeneralAssetWithTags } from '../types'
import { RSS3_DEFAULT_IMAGE } from '../constants'
import { DonationCard } from './components'
import { useDonations } from './hooks'
import { useI18N } from '../../../utils'

const getDonationLink = (address: string, donation: GeneralAssetWithTags) => {
const getDonationLink = (label: string, donation: GeneralAssetWithTags) => {
const { platform, identity, id, type } = donation
return urlcat('https://rss3.bio/:address/singlegitcoin/:platform/:identity/:id/:type', {
address,
return urlcat(`https://${label}.bio/singlegitcoin/:platform/:identity/:id/:type`, {
platform,
identity,
id,
type,
type: type.replaceAll('-', '.'),
})
}

Expand All @@ -30,28 +29,23 @@ const useStyles = makeStyles()((theme) => ({
}))

export interface DonationPageProps {
address: string
addressName?: AddressName
donations?: GeneralAsset[]
}

export function DonationPage(props: DonationPageProps) {
const { address } = props
const { classes } = useStyles()
const { donations, loading } = useDonations(address)
const { addressName, donations = [] } = props
const { t } = useI18N()
const { classes } = useStyles()

if (!addressName) return null

if (loading) {
return (
<div className="flex justify-center items-center">
<CircularProgress />
</div>
)
}
return (
<section className="grid grid-cols-1 gap-4 py-4">
{donations.map((donation) => (
<Link
className={classes.link}
href={getDonationLink(address, donation)}
href={getDonationLink(addressName.label, donation)}
key={donation.id}
target="_blank"
rel="noopener noreferrer">
Expand Down
Loading