Last active
October 23, 2021 22:18
-
-
Save rsolari/5c789aa0bcb9153d93b3d14c2770b8d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Typescript | |
import { isMobile, isChrome, isSafari } from "react-device-detect" | |
// constants | |
const shouldShowWalletConnect = !( | |
isMobile && | |
isChrome && | |
typeof window !== undefined && | |
window?.ethereum?.isMetaMask | |
) | |
const shouldShowMetaMaskOption = !( | |
isMobile && | |
(isChrome || isSafari) && | |
shouldShowWalletConnect | |
) | |
{shouldShowMetaMaskOption ? ( | |
<WalletButton | |
icon={<MetaMaskIcon height={8} width={8} />} | |
walletName="MetaMask" | |
onClick={activateMetamask} | |
/> | |
) : null} | |
{shouldShowWalletConnect ? ( | |
<WalletButton | |
icon={<WalletConnectIcon height={8} width={8} />} | |
walletName="WalletConnect" | |
onClick={activateWalletConnect} | |
/> | |
) : null} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment