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
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ export function ProfileTabContent(props: ProfileTabContentProps) {
? currentConnectedPersona?.identifier?.publicKeyAsHex
: currentPersonaBinding?.persona

const isCurrentConnectedPersonaBind = personaList.some(
(persona) => persona.persona === currentConnectedPersona?.identifier?.publicKeyAsHex.toLowerCase(),
)

const { value: personaProof, retry: retryProof } = useAsyncRetry(async () => {
if (!personaPublicKey) return
return NextIDProof.queryExistedBindingByPersona(personaPublicKey)
Expand Down Expand Up @@ -140,10 +144,12 @@ export function ProfileTabContent(props: ProfileTabContentProps) {
}))

const selectedTabId = selectedTab ?? first(tabs)?.id
const componentTabId =
isTwitter(activatedSocialNetworkUI) && ((isOwn && addressList?.length === 0) || isWeb3ProfileDisable)
? displayPlugins?.find((tab) => tab?.pluginID === PluginId.NextID)?.ID
: selectedTabId
const showNextID =
isTwitter(activatedSocialNetworkUI) &&
((isOwn && addressList?.length === 0) || isWeb3ProfileDisable || (isOwn && !isCurrentConnectedPersonaBind))
const componentTabId = showNextID
? displayPlugins?.find((tab) => tab?.pluginID === PluginId.NextID)?.ID
: selectedTabId

const handleOpenDialog = () => {
CrossIsolationMessages.events.requestWeb3ProfileDialog.sendToAll({
Expand Down Expand Up @@ -189,8 +195,6 @@ export function ProfileTabContent(props: ProfileTabContentProps) {
})
}, [identity.identifier?.userId])

// console.log({ identity, socialAddressList, addressList, wallets })

if (hidden) return null

if (!identity.identifier?.userId || loadingSocialAddressList || loadingPersonaList)
Expand All @@ -209,7 +213,7 @@ export function ProfileTabContent(props: ProfileTabContentProps) {
return (
<div className={classes.root}>
<div>
{tabs.length && (
{tabs.length && !showNextID && (
<ConcealableTabs<string>
tabs={tabs}
selectedId={selectedTabId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import LRU from 'lru-cache'

const cache = new LRU<string, Promise<NextIDAvatarMeta | undefined>>({
max: 500,
maxAge: 60 * 1000,
ttl: 60 * 1000,
})

type GetNFTAvatar = (
Expand Down
12 changes: 10 additions & 2 deletions packages/mask/src/plugins/NextID/components/NextIdPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ const useStyles = makeStyles()((theme) => ({
},
button: {
borderRadius: '99px',
backgroundColor: theme.palette.maskColor.dark,
backgroundColor: '#07101b',
color: '#fff',
':hover': {
color: 'fff',
backgroundColor: '#07101b',
},
},
}))

Expand All @@ -131,7 +135,11 @@ export function NextIdPage({ persona }: NextIdPageProps) {
const personaActionButton = useMemo(() => {
if (!personaConnectStatus.action) return null
const button = personaConnectStatus.hasPersona ? t.connect_persona() : t.create_persona()
return <Button onClick={personaConnectStatus.action}>{button}</Button>
return (
<Button className={classes.button} onClick={personaConnectStatus.action}>
{button}
</Button>
)
}, [personaConnectStatus, t])

const { value: currentPersona, loading: loadingPersona } = useAsyncRetry(async () => {
Expand Down