Skip to content

Commit

Permalink
Merge pull request #18 from rarimo/fix/metamask-link
Browse files Browse the repository at this point in the history
feat add metamsak link at other browsers
  • Loading branch information
WhiteNik16 authored Dec 12, 2023
2 parents b20a0b4 + ef330a9 commit 6a87cb6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const config = {
} as Record<keyof typeof FALLBACK_SUPPORTED_CHAINS, Chain>,
DEFAULT_CHAIN: import.meta.env.VITE_DEFAULT_CHAIN as SUPPORTED_CHAINS,
ROBOTORNOT_LINK: import.meta.env.VITE_ROBOTORNOT_LINK,
OTHER_BROWSER_METAMASK_LINK: 'https://metamask.io/download/',
CHROME_METAMASK_ADDON_LINK:
'https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn',
FIREFOX_METAMASK_ADDON_LINK:
Expand Down
9 changes: 2 additions & 7 deletions src/pages/SignInPage/SignInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { useNavigate } from 'react-router-dom'
import { AppButton, Icon } from '@/common'
import { useMetamaskZkpSnapContext, useWeb3Context } from '@/contexts'
import { IconNames, RoutesPaths } from '@/enums'
// import { bus, BUS_EVENTS } from '@/helpers'

const SignInPage = () => {
const [isPending, setIsPending] = useState(false)
Expand Down Expand Up @@ -55,17 +54,13 @@ const SignInPage = () => {

const currentBrowser = chromeAgent || firefoxAgent || operaAgent || ''

if (!currentBrowser) return ''
if (!currentBrowser) return config.OTHER_BROWSER_METAMASK_LINK

return get(browserExtensionsLinks, currentBrowser, '')
}, [isMetamaskInstalled])

const openInstallMetamaskLink = useCallback(() => {
if (!installMMLink) {
// bus.emit(BUS_EVENTS.warning, `Your browser is not support Metamask`)

return
}
if (!installMMLink) return

setIsPending(true)

Expand Down

0 comments on commit 6a87cb6

Please sign in to comment.