diff --git a/packages/mask/src/components/DataSource/useNextID.ts b/packages/mask/src/components/DataSource/useNextID.ts index f4fe8706a8e0..4f764c6aa74a 100644 --- a/packages/mask/src/components/DataSource/useNextID.ts +++ b/packages/mask/src/components/DataSource/useNextID.ts @@ -1,4 +1,4 @@ -import { useAsync, useAsyncRetry } from 'react-use' +import { useAsyncRetry } from 'react-use' import type { NextIDPlatform } from '@masknet/shared-base' import Services from '../../extension/service' import { useMemo, useState } from 'react' @@ -13,15 +13,16 @@ import { useValueRef } from '@masknet/shared' import { queryExistedBindingByPersona, queryExistedBindingByPlatform, queryIsBound } from '@masknet/web3-providers' export const usePersonaBoundPlatform = (personaPublicKey: string) => { - useAsyncRetry(() => { + return useAsyncRetry(() => { return queryExistedBindingByPersona(personaPublicKey) }, [personaPublicKey]) } let isOpenedVerifyDialog = false +let isOpenedFromButton = false export const useNextIDBoundByPlatform = (platform: NextIDPlatform, identity: string) => { - useAsyncRetry(() => { + return useAsyncRetry(() => { return queryExistedBindingByPlatform(platform, identity) }, [platform, identity]) } @@ -45,7 +46,7 @@ export function useNextIDConnectStatus() { lastState.username || (lastRecognized.identifier.isUnknown ? '' : lastRecognized.identifier.userId), ) - const { value: isVerified = false } = useAsync(async () => { + const { value: isVerified = false, retry } = useAsyncRetry(async () => { if (lastState.status === SetupGuideStep.FindUsername) return true if (isOpenedVerifyDialog) return true if (!enableNextID || !username || !personaConnectStatus.connected) return true @@ -53,7 +54,10 @@ export function useNextIDConnectStatus() { const currentPersona = await Services.Settings.getCurrentPersona() if (!currentPersona?.publicHexKey) return true - if (dismissVerifyNextID[ui.networkIdentifier].value[`${username}_${currentPersona.identifier.toText()}`]) + if ( + dismissVerifyNextID[ui.networkIdentifier].value[`${username}_${currentPersona.identifier.toText()}`] && + !isOpenedFromButton + ) return true const platform = ui.configuration.nextIDConfig?.platform as NextIDPlatform | undefined @@ -68,8 +72,16 @@ export function useNextIDConnectStatus() { }) isOpenedVerifyDialog = true + isOpenedFromButton = false return false - }, [username, enableNextID, lastStateRef.value]) + }, [username, enableNextID, lastStateRef.value, isOpenedVerifyDialog]) - return isVerified + return { + isVerified, + reset: () => { + isOpenedVerifyDialog = false + isOpenedFromButton = true + retry() + }, + } } diff --git a/packages/mask/src/components/DataSource/usePersonaConnectStatus.ts b/packages/mask/src/components/DataSource/usePersonaConnectStatus.ts index 1d19ebb5e04f..a48493fa5e0a 100644 --- a/packages/mask/src/components/DataSource/usePersonaConnectStatus.ts +++ b/packages/mask/src/components/DataSource/usePersonaConnectStatus.ts @@ -1,6 +1,7 @@ import { DashboardRoutes, ProfileIdentifier } from '@masknet/shared-base' import stringify from 'json-stable-stringify' import { useMemo } from 'react' +import type { Persona } from '../../database' import Services from '../../extension/service' import { currentSetupGuideStatus } from '../../settings/settings' import { activatedSocialNetworkUI } from '../../social-network' @@ -27,13 +28,13 @@ export function usePersonaConnectStatus() { return useMemo(() => { const id = new ProfileIdentifier(activatedSocialNetworkUI.networkIdentifier, lastRecognized.identifier.userId) let connected = false + let currentConnectedPersona: Persona | undefined personas.forEach((p) => { - p.identifier - if (p.linkedProfiles.get(id)) { - connected = true - } + if (!p.linkedProfiles.get(id)) return + connected = true + currentConnectedPersona = p }) const action = !personas.length ? createPersona : !connected ? connectPersona : null - return { connected, action, hasPersona: !!personas.length } + return { connected, action, hasPersona: !!personas.length, currentConnectedPersona } }, [personas, lastRecognized, activatedSocialNetworkUI]) } diff --git a/packages/mask/src/components/InjectedComponents/ProfileTabContent.tsx b/packages/mask/src/components/InjectedComponents/ProfileTabContent.tsx index f608c681722a..72015130c79b 100644 --- a/packages/mask/src/components/InjectedComponents/ProfileTabContent.tsx +++ b/packages/mask/src/components/InjectedComponents/ProfileTabContent.tsx @@ -1,6 +1,7 @@ import { useEffect, useMemo, useState } from 'react' import { useUpdateEffect } from 'react-use' import { first } from 'lodash-unified' +import type { NextIDPlatform } from '@masknet/shared-base' import { Box, CircularProgress } from '@mui/material' import { makeStyles, useStylesExtends } from '@masknet/theme' import { useAddressNames } from '@masknet/web3-shared-evm' @@ -8,7 +9,10 @@ import { createInjectHooksRenderer, useActivatedPluginsSNSAdaptor, Plugin, Plugi import { PageTab } from '../InjectedComponents/PageTab' import { useLocationChange } from '../../utils/hooks/useLocationChange' import { MaskMessages, useI18N } from '../../utils' -import { useCurrentVisitingIdentity } from '../DataSource/useActivatedUI' +import { useCurrentVisitingIdentity, useLastRecognizedIdentity } from '../DataSource/useActivatedUI' +import { useNextIDBoundByPlatform } from '../DataSource/useNextID' +import { usePersonaConnectStatus } from '../DataSource/usePersonaConnectStatus' +import { activatedSocialNetworkUI } from '../../social-network' function getTabContent(tabId: string) { return createInjectHooksRenderer(useActivatedPluginsSNSAdaptor.visibility.useAnyMode, (x) => { @@ -39,8 +43,18 @@ export function ProfileTabContent(props: ProfileTabContentProps) { const [hidden, setHidden] = useState(true) const [selectedTab, setSelectedTab] = useState() + const currentIdentity = useLastRecognizedIdentity() const identity = useCurrentVisitingIdentity() + const { currentConnectedPersona } = usePersonaConnectStatus() + const platform = activatedSocialNetworkUI.configuration.nextIDConfig?.platform as NextIDPlatform const { value: addressNames = [], loading: loadingAddressNames } = useAddressNames(identity) + const { value: personaList = [], loading: loadingPersonaList } = useNextIDBoundByPlatform( + platform as NextIDPlatform, + identity.identifier.userId, + ) + const currentAccountNotConnectPersona = + currentIdentity.identifier.userId === identity.identifier.userId && + personaList.findIndex((persona) => persona?.persona === currentConnectedPersona?.publicHexKey) === -1 const tabs = useActivatedPluginsSNSAdaptor('any') .flatMap((x) => x.ProfileTabs?.map((y) => ({ ...y, pluginID: x.ID })) ?? []) @@ -81,12 +95,15 @@ export function ProfileTabContent(props: ProfileTabContentProps) { }, [identity]) const ContentComponent = useMemo(() => { - return getTabContent(selectedTabComputed?.ID ?? '') + const tab = currentAccountNotConnectPersona + ? tabs?.find((tab) => tab?.pluginID === PluginId.NextID)?.ID + : selectedTabComputed?.ID + return getTabContent(tab ?? '') }, [selectedTabComputed, identity.identifier]) if (hidden) return null - if (loadingAddressNames) + if (loadingAddressNames || loadingPersonaList) return (
- + persona.persona)} + />
) diff --git a/packages/mask/src/components/InjectedComponents/ToolboxUnstyled.tsx b/packages/mask/src/components/InjectedComponents/ToolboxUnstyled.tsx index 79728142ea19..915d3dd38c8d 100644 --- a/packages/mask/src/components/InjectedComponents/ToolboxUnstyled.tsx +++ b/packages/mask/src/components/InjectedComponents/ToolboxUnstyled.tsx @@ -84,7 +84,7 @@ export interface ToolboxHintProps { } export function ToolboxHintUnstyled(props: ToolboxHintProps) { const { t } = useI18N() - const isNextIDVerified = useNextIDConnectStatus() + const { isVerified: isNextIDVerified } = useNextIDConnectStatus() const { ListItemButton = MuiListItemButton, ListItemText = MuiListItemText, diff --git a/packages/mask/src/plugins/NextID/SNSAdaptor/index.tsx b/packages/mask/src/plugins/NextID/SNSAdaptor/index.tsx index aee858243f8e..149064057546 100644 --- a/packages/mask/src/plugins/NextID/SNSAdaptor/index.tsx +++ b/packages/mask/src/plugins/NextID/SNSAdaptor/index.tsx @@ -5,6 +5,7 @@ import { NextIdPage } from '../components/NextIdPage' import { RootContext } from '../contexts' import { TipButton, TipTaskManager } from '../components/tip' import { Flags } from '../../../../shared' +import { EMPTY_LIST } from '@masknet/web3-shared-evm' const sns: Plugin.SNSAdaptor.Definition = { ...base, @@ -15,7 +16,7 @@ const sns: Plugin.SNSAdaptor.Definition = { label: 'Wallet', priority: 10, UI: { - TabContent: NextIdPage, + TabContent: ({ personaList = EMPTY_LIST }) => , }, }, ], diff --git a/packages/mask/src/plugins/NextID/components/BindDialog.tsx b/packages/mask/src/plugins/NextID/components/BindDialog.tsx index f494d3687b22..f7bea0163bb8 100644 --- a/packages/mask/src/plugins/NextID/components/BindDialog.tsx +++ b/packages/mask/src/plugins/NextID/components/BindDialog.tsx @@ -4,7 +4,7 @@ import { useAsyncRetry } from 'react-use' import Services from '../../../extension/service' import { isSameAddress } from '@masknet/web3-shared-evm' import type { Persona } from '../../../database' -import type { Binding } from '../types' +import type { Binding } from '@masknet/shared-base' import { BindPanelUI } from './BindPanelUI' import { useAccount } from '@masknet/plugin-infra' import { useCustomSnackbar } from '@masknet/theme' diff --git a/packages/mask/src/plugins/NextID/components/BindingItem.tsx b/packages/mask/src/plugins/NextID/components/BindingItem.tsx index 225546f430d7..0d07c9323d96 100644 --- a/packages/mask/src/plugins/NextID/components/BindingItem.tsx +++ b/packages/mask/src/plugins/NextID/components/BindingItem.tsx @@ -1,7 +1,7 @@ import { ChainId, formatEthereumAddress } from '@masknet/web3-shared-evm' import { Box, Link, Stack, Typography } from '@mui/material' import { memo } from 'react' -import { Platform } from '../types' +import { NextIDPlatform } from '@masknet/shared-base' import { DeleteIcon } from '@masknet/icons' import { makeStyles } from '@masknet/theme' import { CopyIconButton } from './CopyIconButton' @@ -42,7 +42,7 @@ const useStyles = makeStyles()((theme) => ({ }, })) interface Item { - platform: Platform + platform: NextIDPlatform identity: string enableAction: boolean onUnBind(address: string): void @@ -54,7 +54,7 @@ export const BindingItem = memo(({ platform, identity, enableAction, onUnB const { classes } = useStyles() const networkDescriptor = useNetworkDescriptor(ChainId.Mainnet, NetworkPluginID.PLUGIN_EVM) - if (platform === Platform.ethereum) { + if (platform === NextIDPlatform.Ethereum) { return ( ({ tip: { @@ -20,6 +24,21 @@ const useStyles = makeStyles()((theme) => ({ alignItems: 'center', color: theme.palette.text.primary, }, + verifyIntro: { + fontSize: '14px', + fontWeight: 500, + marginBottom: '12px', + }, + verifyDetail: { + fontSize: '14px', + fontWeight: 400, + color: theme.palette.grey[700], + }, + verifyInstruction: { + fontSize: '14px', + fontWeight: 400, + color: theme.palette.grey[700], + }, skeleton: { borderRadius: 8, margin: theme.spacing(1), @@ -29,19 +48,22 @@ const useStyles = makeStyles()((theme) => ({ }, })) -interface NextIDPageProps {} +interface NextIDPageProps { + personaList: string[] +} -export function NextIdPage({}: NextIDPageProps) { +export function NextIdPage({ personaList }: NextIDPageProps) { const t = useI18N() const { classes } = useStyles() const currentProfileIdentifier = useLastRecognizedIdentity() const visitingPersonaIdentifier = useCurrentVisitingIdentity() const personaConnectStatus = usePersonaConnectStatus() + const { reset, isVerified } = useNextIDConnectStatus() const [openBindDialog, toggleBindDialog] = useState(false) const [unbindAddress, setUnBindAddress] = useState() const [count, { inc }] = useCounter(0) - + const platform = activatedSocialNetworkUI.configuration.nextIDConfig?.platform as NextIDPlatform const isOwn = currentProfileIdentifier.identifier.toText() === visitingPersonaIdentifier.identifier.toText() const personaActionButton = useMemo(() => { @@ -56,22 +78,26 @@ export function NextIdPage({}: NextIDPageProps) { }, [personaConnectStatus, t]) const { value: currentPersona, loading: loadingPersona } = useAsyncRetry(() => { - if (!currentProfileIdentifier) return Promise.resolve(undefined) - return Services.Identity.queryPersonaByProfile(currentProfileIdentifier.identifier) - }, [currentProfileIdentifier, personaConnectStatus.hasPersona]) + if (!visitingPersonaIdentifier) return Promise.resolve(undefined) + return Services.Identity.queryPersonaByProfile(visitingPersonaIdentifier.identifier) + }, [visitingPersonaIdentifier, personaConnectStatus.hasPersona]) + + const { value: isAccountVerified, loading: loadingVerifyInfo } = useAsync(() => { + if (!currentPersona?.publicHexKey) return Promise.resolve(undefined) + return queryIsBound(currentPersona.publicHexKey, platform, visitingPersonaIdentifier.identifier.userId) + }, [isOwn, currentPersona, visitingPersonaIdentifier, isVerified]) const { value: bindings, loading } = useAsync(async () => { if (!currentPersona) return - if (isOwn) { - return Services.Helper.queryExistedBinding(currentPersona.identifier) - } - - if (!visitingPersonaIdentifier) return null - const visitingPersona = await Services.Identity.queryPersonaByProfile(visitingPersonaIdentifier.identifier) + return queryExistedBindingByPersona(currentPersona.publicHexKey!) + }, [currentPersona, isOwn, count]) - if (!visitingPersona) return null - return Services.Helper.queryExistedBinding(visitingPersona.identifier) - }, [currentPersona, count, visitingPersonaIdentifier, isOwn]) + const onVerify = async () => { + reset() + const firstTab = TAB_SELECTOR?.[platform]?.evaluate()?.querySelector('div')?.parentNode + ?.firstChild as HTMLElement + firstTab.click() + } if (personaActionButton) { return ( @@ -81,7 +107,7 @@ export function NextIdPage({}: NextIDPageProps) { ) } - if (loading || loadingPersona) { + if (loading || loadingPersona || loadingVerifyInfo) { return ( <> {Array.from({ length: 2 }) @@ -95,7 +121,38 @@ export function NextIdPage({}: NextIDPageProps) { ) } - if (bindings?.proofs.length) { + if (!isAccountVerified) { + return ( + + {isOwn ? ( + + {t.verify_Twitter_ID_intro()} + {t.verify_Twitter_ID()} + + ) : ( + + + {t.connect_wallet__other_user_tip_intro()} + + + {t.connect_wallet_other_user_instruction()} + + {t.connect_wallet_other_user_tip1()} + {t.connect_wallet_other_user_tip2()} + + )} + {isOwn && ( + + + + )} + + ) + } + + if (bindings?.proofs.filter((proof) => proof.platform === NextIDPlatform.Ethereum).length) { return ( <> @@ -104,7 +161,7 @@ export function NextIdPage({}: NextIDPageProps) { @@ -145,12 +202,19 @@ export function NextIdPage({}: NextIDPageProps) { {isOwn ? ( - {t.connect_wallet_tip_intro()} - {t.connect_wallet_tip()} + {t.verify_wallet_intro()} + {t.verify_wallet()} ) : ( - {t.connect_wallet__other_user_tip_intro()} + + {t.connect_wallet__other_user_tip_intro()} + + + {t.connect_wallet_other_user_instruction()} + + {t.connect_wallet_other_user_tip1()} + {t.connect_wallet_other_user_tip2()} )} {isOwn && ( diff --git a/packages/mask/src/plugins/NextID/components/UnbindConfirm.tsx b/packages/mask/src/plugins/NextID/components/UnbindConfirm.tsx new file mode 100644 index 000000000000..f345639daecd --- /dev/null +++ b/packages/mask/src/plugins/NextID/components/UnbindConfirm.tsx @@ -0,0 +1,74 @@ +import { memo, useState } from 'react' +import { Box, DialogContent, Button } from '@mui/material' +import { useWeb3State } from '@masknet/plugin-infra' +import { useI18N } from '../locales' +import { makeStyles, MaskDialog } from '@masknet/theme' + +const useStyles = makeStyles()((theme) => ({ + wrapper: { + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + flexDirection: 'column', + padding: '24px !important', + }, + title: { + fontSize: '16px', + fontWeight: 500, + marginBottom: '24px', + }, + content: { + marginBottom: '36px', + color: theme.palette.grey[700], + }, + confirmButton: { + width: '100%', + marginBottom: '16px', + backgroundColor: 'red', + color: theme.palette.common.white, + }, + cancelButton: { + width: '100%', + marginBottom: '16px', + }, +})) + +interface UnbindConfirmProps { + unbindAddress: string + onClose(): void + onConfirm(): void +} + +export enum DialogTabs { + persona = 0, + wallet = 1, +} + +export const UnbindConfirm = memo(({ onClose, unbindAddress, onConfirm }) => { + const t = useI18N() + const { classes } = useStyles() + const { Utils } = useWeb3State() + + const [isShow, setIsShow] = useState(true) + + const handleConfirm = () => { + onConfirm() + setIsShow(false) + } + return ( + + + + {t.delete()} {Utils?.formatAddress?.(unbindAddress, 4)} ? + + {t.disconnect_warning()} + + + + + ) +}) diff --git a/packages/mask/src/plugins/NextID/components/UnbindDialog.tsx b/packages/mask/src/plugins/NextID/components/UnbindDialog.tsx index 01da663f65a5..f96b3555d8b6 100644 --- a/packages/mask/src/plugins/NextID/components/UnbindDialog.tsx +++ b/packages/mask/src/plugins/NextID/components/UnbindDialog.tsx @@ -1,16 +1,17 @@ -import { memo } from 'react' +import { memo, useState } from 'react' import { useI18N } from '../locales' import { useAsyncRetry } from 'react-use' import Services from '../../../extension/service' import { isSameAddress, useAccount } from '@masknet/web3-shared-evm' import type { Persona } from '../../../database' -import type { Binding } from '../types' +import type { Binding } from '@masknet/shared-base' import { useCustomSnackbar } from '@masknet/theme' import { usePersonaSign } from '../hooks/usePersonaSign' import { useWalletSign } from '../hooks/useWalletSign' import { useBindPayload } from '../hooks/useBindPayload' import { delay } from '@dimensiondev/kit' import { UnbindPanelUI } from './UnbindPanelUI' +import { UnbindConfirm } from './UnbindConfirm' interface VerifyWalletDialogProps { unbindAddress: string @@ -23,6 +24,9 @@ interface VerifyWalletDialogProps { export const UnbindDialog = memo(({ unbindAddress, onClose, persona, onUnBind, bounds }) => { const account = useAccount() const t = useI18N() + + const [openSecondDialog, setSecondDialog] = useState(false) + const { showSnackbar } = useCustomSnackbar() const currentIdentifier = persona.identifier const isBound = !!bounds.find((x) => isSameAddress(x.identity, unbindAddress)) @@ -58,22 +62,25 @@ export const UnbindDialog = memo(({ unbindAddress, onCl }, [walletSignState.value, personaSignState.value, unbindAddress]) return ( - + <> + setSecondDialog(true)} onClose={onClose} /> + + ) }) diff --git a/packages/mask/src/plugins/NextID/constants.ts b/packages/mask/src/plugins/NextID/constants.ts index 1b53a2235552..e2945d63e17d 100644 --- a/packages/mask/src/plugins/NextID/constants.ts +++ b/packages/mask/src/plugins/NextID/constants.ts @@ -1,6 +1,12 @@ import { PluginId } from '@masknet/plugin-infra' +import type { LiveSelector } from '@dimensiondev/holoflows-kit' +import { searchAllProfileTabSelector } from '../../social-network-adaptor/twitter.com/utils/selector' export const PLUGIN_ID = PluginId.NextID export const PLUGIN_META_KEY = `${PluginId.NextID}:1` export const PLUGIN_DESCRIPTION = 'Next ID' export const PLUGIN_NAME = 'NextID' + +export const TAB_SELECTOR: { [key: string]: LiveSelector } = { + twitter: searchAllProfileTabSelector(), +} diff --git a/packages/mask/src/plugins/NextID/locales/en-US.json b/packages/mask/src/plugins/NextID/locales/en-US.json index c027234ab216..19d5bd1e49a1 100644 --- a/packages/mask/src/plugins/NextID/locales/en-US.json +++ b/packages/mask/src/plugins/NextID/locales/en-US.json @@ -2,11 +2,19 @@ "wallet": "Wallet", "persona": "Persona", "unsupported_network": "Unsupported Network", - "connect_wallet__other_user_tip_intro": "This user has no wallets connected.", - "connect_wallet_tip_intro": "Connect you wallet.", - "connect_wallet_tip": "In the Web3 tab, you can show your wallet addresses for receiving tips, NFT collections, donation records, and other on-chain feeds to friends who have also installed the Mask extension.", - "verify_wallet_button": "Verify Your Wallet", - "add_wallet_button": "Add A Wallet", + "connect_wallet__other_user_tip_intro": "Wallets not found.", + "connect_wallet_other_user_tip1": "1. Switch to the user’s tweets page and back.", + "connect_wallet_other_user_tip2": "2. Invite the user to install the Mask extension and post a verification tweet.", + "connect_wallet_other_user_instruction": "The user might have not connected wallets yet. You can try as following:", + "connect_wallet_tip": "In this Web 3 section, you can show your address for receiving tips, your NFT collection, donation records, and other on-chain information to friends who have installed Mask Network.", + "verify_wallet_intro": "Verify your wallet here.", + "verify_wallet": "In the Web3 tab, you can show your wallet addresses for receiving tips, NFT collections, donation records, and other on-chain feeds to friends who have also installed the Mask extension.", + "verify_Twitter_ID_intro": "Verify your Twitter ID here.", + "verify_Twitter_ID": "You can verify your Twitter ID with Next.ID to enhance your Web3 experience.", + "verify_other_Twitter_ID_intro": "This user has not connected wallets here.", + "verify_Twitter_ID_button": "Verify your Twitter ID", + "verify_wallet_button": "Verify your wallet", + "add_wallet_button": "Add wallet", "verify_wallet_dialog_title": "Verify your wallet", "bind_wallet_bound_error": "This wallet address has already been connected.", "unbind_wallet_same_account_error": "Please switch to the address that you want to disconnect.", @@ -31,5 +39,9 @@ "unbind_persona_tip": "Choose either your Persona or the currently connected wallet to sign to disconnect.", "unbind_wallet_tip": "Choose either your Persona or the currently connected wallet to sign to disconnect.", "done": "Done", - "copy_success_of_wallet_address": "Copy wallet address successfully!" + "confirm": "Confirm", + "cancel": "Cancel", + "delete": "Delete", + "copy_success_of_wallet_address": "Copy wallet address successfully!", + "disconnect_warning": "This wallet will no longer show up in your web 3 profile page. Your Mask friends can no longer give tips to this wallet, or browse NFTs, donations and other on-chain information of this address." } diff --git a/packages/mask/src/plugins/NextID/locales/qya-AA.json b/packages/mask/src/plugins/NextID/locales/qya-AA.json index 5aabd852643b..cd5ef7eba5c3 100644 --- a/packages/mask/src/plugins/NextID/locales/qya-AA.json +++ b/packages/mask/src/plugins/NextID/locales/qya-AA.json @@ -2,7 +2,6 @@ "wallet": "crwdns13073:0crwdne13073:0", "persona": "crwdns13075:0crwdne13075:0", "unsupported_network": "crwdns13077:0crwdne13077:0", - "connect_wallet__other_user_tip_intro": "crwdns13225:0crwdne13225:0", "connect_wallet_tip_intro": "crwdns13079:0crwdne13079:0", "connect_wallet_tip": "crwdns13081:0crwdne13081:0", "verify_wallet_button": "crwdns13083:0crwdne13083:0", diff --git a/packages/mask/src/plugins/NextID/locales/zh-CN.json b/packages/mask/src/plugins/NextID/locales/zh-CN.json index b2dde6c40a0e..5cdba45da057 100644 --- a/packages/mask/src/plugins/NextID/locales/zh-CN.json +++ b/packages/mask/src/plugins/NextID/locales/zh-CN.json @@ -2,7 +2,6 @@ "wallet": "钱包", "persona": "身份", "unsupported_network": "此网络尚不支持", - "connect_wallet__other_user_tip_intro": "目前此账号未绑定任何钱包。", "connect_wallet_tip_intro": "在此绑定您的钱包。", "connect_wallet_tip": "在 Web3 中,您可以展示接收打赏的地址,NFT 收藏品,捐赠记录和其他链上信息给已安装Mask Network的好友。", "verify_wallet_button": "验证您的钱包", diff --git a/packages/mask/src/plugins/NextID/types/index.ts b/packages/mask/src/plugins/NextID/types/index.ts index 9d4b4ccf919c..e4a9d5516746 100644 --- a/packages/mask/src/plugins/NextID/types/index.ts +++ b/packages/mask/src/plugins/NextID/types/index.ts @@ -1,2 +1 @@ export * from './tip' -export * from './nextId' diff --git a/packages/mask/src/plugins/NextID/types/nextId.ts b/packages/mask/src/plugins/NextID/types/nextId.ts deleted file mode 100644 index c4786a338e09..000000000000 --- a/packages/mask/src/plugins/NextID/types/nextId.ts +++ /dev/null @@ -1,8 +0,0 @@ -export enum Platform { - ethereum = 'ethereum', -} - -export interface Binding { - platform: string - identity: string -} diff --git a/packages/mask/src/social-network-adaptor/twitter.com/utils/selector.ts b/packages/mask/src/social-network-adaptor/twitter.com/utils/selector.ts index 50161240acfe..e69e867859a9 100644 --- a/packages/mask/src/social-network-adaptor/twitter.com/utils/selector.ts +++ b/packages/mask/src/social-network-adaptor/twitter.com/utils/selector.ts @@ -31,6 +31,8 @@ export const searchProfileActiveTabSelector: () => LiveSelector = () => querySelector('[aria-label][role="navigation"] [role="tablist"] [role="tab"][aria-selected="true"]') export const searchProfileTabSelector: () => LiveSelector = () => querySelector('[aria-label][role="navigation"] [role="tablist"] [role="tab"][aria-selected="false"]') +export const searchAllProfileTabSelector: () => LiveSelector = () => + querySelector('[aria-label][role="navigation"] [role="tablist"] [role="tab"]') export const searchAppBarBackSelector: () => LiveSelector = () => querySelector('[data-testid="app-bar-back"] > div') export const searchProfileActiveTabStatusLineSelector: () => LiveSelector = () => diff --git a/packages/plugin-infra/src/types.ts b/packages/plugin-infra/src/types.ts index 479f0e1a69bb..870df6f33a70 100644 --- a/packages/plugin-infra/src/types.ts +++ b/packages/plugin-infra/src/types.ts @@ -405,7 +405,11 @@ export namespace Plugin.SNSAdaptor { /** * The injected tab content */ - TabContent: InjectUI<{ identity?: ProfileIdentity; addressNames?: ProfileAddress[] }> + TabContent: InjectUI<{ + identity?: ProfileIdentity + addressNames?: ProfileAddress[] + personaList?: string[] + }> } Utils?: { /** diff --git a/packages/shared-base/src/NextID/type.ts b/packages/shared-base/src/NextID/type.ts index 9454675a4c51..2c15c310ee5f 100644 --- a/packages/shared-base/src/NextID/type.ts +++ b/packages/shared-base/src/NextID/type.ts @@ -16,6 +16,11 @@ export interface NextIDPayload { signPayload: string } +export interface Binding { + platform: NextIDPlatform + identity: string +} + export interface NextIDPersonaBindings { persona: string proofs: {