diff --git a/lang/en.json b/lang/en.json index 57a57fd8c9..0e81f70aa6 100644 --- a/lang/en.json +++ b/lang/en.json @@ -7,6 +7,10 @@ "defaultMessage": "Download App", "description": "src/views/Help/index.tsx" }, + "FaTb0A": { + "defaultMessage": "Install MetaMask", + "description": "src/components/Forms/WalletAuthForm/Select.tsx" + }, "JMRVO6": { "defaultMessage": "Matters Community", "description": "src/views/Help/index.tsx" diff --git a/lang/zh-Hans.json b/lang/zh-Hans.json index d80ee26b5b..d05efc5d03 100644 --- a/lang/zh-Hans.json +++ b/lang/zh-Hans.json @@ -11,6 +11,10 @@ "defaultMessage": "下载应用", "description": "src/views/Help/index.tsx" }, + "FaTb0A": { + "defaultMessage": "安装 MetaMask", + "description": "src/components/Forms/WalletAuthForm/Select.tsx" + }, "JMRVO6": { "defaultMessage": "社区共建基地", "description": "src/views/Help/index.tsx" diff --git a/lang/zh-Hant.json b/lang/zh-Hant.json index 644eb19210..ed8cf41ad2 100644 --- a/lang/zh-Hant.json +++ b/lang/zh-Hant.json @@ -11,6 +11,10 @@ "defaultMessage": "下載應用", "description": "src/views/Help/index.tsx" }, + "FaTb0A": { + "defaultMessage": "安裝 MetaMask", + "description": "src/components/Forms/WalletAuthForm/Select.tsx" + }, "JMRVO6": { "defaultMessage": "社區共建基地", "description": "src/views/Help/index.tsx" diff --git a/src/common/enums/externalLinks.ts b/src/common/enums/externalLinks.ts index a83e1784b6..7aaa75141b 100644 --- a/src/common/enums/externalLinks.ts +++ b/src/common/enums/externalLinks.ts @@ -17,6 +17,7 @@ export const EXTERNAL_LINKS = { 'https://docs.like.co/v/zh/user-guide/likecoin-button/superlike?utm_source=Matters&utm_medium=website&utm_campaign=superlike_funnel', PLANET: 'https://www.planetable.xyz/', ENS_DOCS: 'https://docs.ens.domains/', + METAMASK: 'https://metamask.io/download/', } export const GUIDE_LINKS = { diff --git a/src/common/utils/analytics.ts b/src/common/utils/analytics.ts index 2da0b5b49b..296a63bd14 100644 --- a/src/common/utils/analytics.ts +++ b/src/common/utils/analytics.ts @@ -53,6 +53,7 @@ interface ClickButtonProp { | 'share_user' | 'signup' | 'login/signup' + | 'installMetaMask' | 'connectorMetaMask' | 'connectorWalletConnect' | 'top_up' diff --git a/src/components/Forms/WalletAuthForm/Select.tsx b/src/components/Forms/WalletAuthForm/Select.tsx index 78bfe43647..f5d0e7c3d9 100644 --- a/src/components/Forms/WalletAuthForm/Select.tsx +++ b/src/components/Forms/WalletAuthForm/Select.tsx @@ -1,7 +1,8 @@ import React, { useContext, useEffect } from 'react' +import { FormattedMessage } from 'react-intl' import { useAccount, useConnect, useDisconnect } from 'wagmi' -import { GUIDE_LINKS } from '~/common/enums' +import { EXTERNAL_LINKS, GUIDE_LINKS } from '~/common/enums' import { analytics } from '~/common/utils' import { Dialog, @@ -190,7 +191,7 @@ const Select: React.FC = ({ )} }> - {injectedConnector?.ready && ( + {injectedConnector?.ready ? ( = ({ role="button" right={isMetaMaskLoading ? : null} /> + ) : ( + } + size="md" + spacing="xtight" + > + + + } + htmlHref={EXTERNAL_LINKS.METAMASK} + onClick={() => { + analytics.trackEvent('click_button', { + type: 'installMetaMask', + }) + }} + role="button" + /> )}