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
2 changes: 1 addition & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"imtokenv2",
"investables",
"ipfs",
"IPFSHTTP",
"ipfshttp",
"ipfsurl",
"ittr",
"jailbroken",
Expand Down
14 changes: 13 additions & 1 deletion packages/mask/src/plugins/Avatar/SNSAdaptor/NFTBadgeTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useNFTAvatar } from '../hooks'
import type { AvatarMetaDB } from '../types'
import { RainbowBox } from './RainbowBox'
import type { RSS3_KEY_SNS } from '../constants'
import { makeStyles } from '@masknet/theme'

interface NFTBadgeTimelineProps extends withClasses<'root'> {
userId: string
Expand All @@ -14,11 +15,18 @@ interface NFTBadgeTimelineProps extends withClasses<'root'> {
snsKey: RSS3_KEY_SNS
}

const useStyles = makeStyles()(() => ({
root: {
transform: 'scale(0.97)',
},
}))

export function NFTBadgeTimeline(props: NFTBadgeTimelineProps) {
const { userId, avatarId, width, height, snsKey } = props
const { loading, value: _avatar } = useNFTAvatar(userId, snsKey)
const [avatar, setAvatar] = useState<AvatarMetaDB>()
const [avatarId_, setAvatarId_] = useState('')
const { classes } = useStyles()

const onUpdate = (data: AvatarMetaDB) => {
if (!data.address || !data.tokenId) {
Expand All @@ -42,5 +50,9 @@ export function NFTBadgeTimeline(props: NFTBadgeTimelineProps) {
if (!avatar) return null
if (avatarId_ && avatar.avatarId !== avatarId_) return null

return loading ? <CircularProgress size={width} /> : <RainbowBox width={width} height={height} radius="100%" />
return loading ? (
<CircularProgress size={width} />
) : (
<RainbowBox width={width} height={height} radius="100%" classes={{ root: classes.root }} />
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function injectNFTAvatarInTwitter(signal: AbortSignal) {

const useStyles = makeStyles()(() => ({
root: {
transform: 'scale(1.025)',
transform: 'scale(1.022)',
position: 'absolute',
textAlign: 'center',
color: 'white',
Expand Down Expand Up @@ -160,8 +160,8 @@ function NFTAvatarInTwitter() {
border: 2px solid #00f8ff;
}
`
rainBowElement.current = linkDom.firstElementChild
if (showAvatar) linkDom.firstElementChild.classList.add('rainbowBorder')
rainBowElement.current = linkDom.firstElementChild.nextElementSibling
linkDom.firstElementChild.nextElementSibling?.classList.add('rainbowBorder')
linkDom.appendChild(style)
}
}
Expand All @@ -173,6 +173,8 @@ function NFTAvatarInTwitter() {

if (borderElement.current && linkDom?.firstElementChild !== borderElement.current) {
linkDom?.insertBefore(borderElement.current, linkDom.firstChild)
}
if (rainBowElement.current) {
rainBowElement.current?.classList.remove('rainbowBorder')
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/web3-constants/evm/artblocks.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"Arbitrum": "",
"Arbitrum_Rinkeby": "",
"xDai": "",
"Avalanche": "",
"Avalanche_Fuji": "",
"Celo": "",
"Fantom": "",
"Aurora": "",
Expand Down