Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/npm_and_yarn-5100ef9889
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandratran authored Jan 27, 2025
2 parents 4d2d80c + 4c8cb35 commit 24f92c9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/NavbarWallet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ const NavbarWalletComponent: FC = ({
} = useContext(MetamaskProviderContext);
const [dropdownOpen, setDropdownOpen] = useState(false);
const [copyMessage, setCopyMessage] = useState(COPY_TEXT);

const isMobile = sdk.platformManager?.isMobile ?? false;
const isExtensionActive = sdk.isExtensionActive();
const showInstallButton = !isExtensionActive && !isMobile;

const dialogRef = useRef<HTMLUListElement>(null);
const buttonRef = useRef<HTMLButtonElement>(null);
const [userAccount, setUserAccount] = useState(
Expand Down Expand Up @@ -119,7 +123,7 @@ const NavbarWalletComponent: FC = ({

const handleConnectWallet = () => {
trackClickForSegment({
eventName: !isExtensionActive ? "Install MetaMask" : "Connect Wallet",
eventName: showInstallButton ? "Install MetaMask" : "Connect Wallet",
clickType: "Navbar",
userExperience: "B",
responseStatus: null,
Expand All @@ -142,15 +146,15 @@ const NavbarWalletComponent: FC = ({
return !userAccount ? (
<Button
testId={
!isExtensionActive
showInstallButton
? "navbar-cta-install-metamask"
: "navbar-cta-connect-wallet"
}
thin
onClick={handleConnectWallet}
className={styles.navbarButton}
>
{!isExtensionActive ? "Install MetaMask" : "Connect MetaMask"}
{showInstallButton ? "Install MetaMask" : "Connect MetaMask"}
</Button>
) : (
<div className={styles.navbarWallet}>
Expand Down

0 comments on commit 24f92c9

Please sign in to comment.