diff --git a/packages/mask/src/components/InjectedComponents/ProfileTabContent.tsx b/packages/mask/src/components/InjectedComponents/ProfileTabContent.tsx index 361db94198cc..6a230558e4b8 100644 --- a/packages/mask/src/components/InjectedComponents/ProfileTabContent.tsx +++ b/packages/mask/src/components/InjectedComponents/ProfileTabContent.tsx @@ -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) @@ -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({ @@ -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) @@ -209,7 +213,7 @@ export function ProfileTabContent(props: ProfileTabContentProps) { return (
- {tabs.length && ( + {tabs.length && !showNextID && ( tabs={tabs} selectedId={selectedTabId} diff --git a/packages/mask/src/plugins/Avatar/hooks/usePersonaNFTAvatar.ts b/packages/mask/src/plugins/Avatar/hooks/usePersonaNFTAvatar.ts index fa34402cb68d..e6f10cf6cecb 100644 --- a/packages/mask/src/plugins/Avatar/hooks/usePersonaNFTAvatar.ts +++ b/packages/mask/src/plugins/Avatar/hooks/usePersonaNFTAvatar.ts @@ -10,7 +10,7 @@ import LRU from 'lru-cache' const cache = new LRU>({ max: 500, - maxAge: 60 * 1000, + ttl: 60 * 1000, }) type GetNFTAvatar = ( diff --git a/packages/mask/src/plugins/NextID/components/NextIdPage.tsx b/packages/mask/src/plugins/NextID/components/NextIdPage.tsx index 9ce8a11f2529..8714ed63374d 100644 --- a/packages/mask/src/plugins/NextID/components/NextIdPage.tsx +++ b/packages/mask/src/plugins/NextID/components/NextIdPage.tsx @@ -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', + }, }, })) @@ -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 + return ( + + ) }, [personaConnectStatus, t]) const { value: currentPersona, loading: loadingPersona } = useAsyncRetry(async () => {