Skip to content

Commit

Permalink
Merge pull request #3184 from thematters/feat/add-install-metamask-guide
Browse files Browse the repository at this point in the history
feat(signup): add install metamask guide
  • Loading branch information
Jasmine-liang authored Feb 17, 2023
2 parents 8d515a8 + 2df7545 commit e40eead
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions lang/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions lang/zh-Hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions src/common/enums/externalLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions src/common/utils/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ interface ClickButtonProp {
| 'share_user'
| 'signup'
| 'login/signup'
| 'installMetaMask'
| 'connectorMetaMask'
| 'connectorWalletConnect'
| 'top_up'
Expand Down
27 changes: 25 additions & 2 deletions src/components/Forms/WalletAuthForm/Select.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -190,7 +191,7 @@ const Select: React.FC<FormProps> = ({
)}

<Form.List groupName={<Translate id="connectWallet" />}>
{injectedConnector?.ready && (
{injectedConnector?.ready ? (
<Form.List.Item
title={
<TextIcon
Expand All @@ -211,6 +212,28 @@ const Select: React.FC<FormProps> = ({
role="button"
right={isMetaMaskLoading ? <IconSpinner16 color="grey" /> : null}
/>
) : (
<Form.List.Item
title={
<TextIcon
color="black"
icon={<IconMetaMask24 size="md" />}
size="md"
spacing="xtight"
>
<FormattedMessage
defaultMessage="Install MetaMask"
description="src/components/Forms/WalletAuthForm/Select.tsx" />
</TextIcon>
}
htmlHref={EXTERNAL_LINKS.METAMASK}
onClick={() => {
analytics.trackEvent('click_button', {
type: 'installMetaMask',
})
}}
role="button"
/>
)}
<Form.List.Item
title={
Expand Down

1 comment on commit e40eead

@vercel
Copy link

@vercel vercel bot commented on e40eead Feb 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.