Add mobile Keplr connection

This commit is contained in:
Yana
2025-01-07 16:39:17 +02:00
parent 02c5fe2b87
commit 04bc42e333
3 changed files with 37 additions and 13 deletions
@@ -135,7 +135,6 @@ const MobileMenuHeader = ({
>
<NymLogo />
</Link>
<ConnectWallet size="small" />
<Box
sx={{
@@ -149,6 +148,7 @@ const MobileMenuHeader = ({
</IconButton>
</Box>
</Box>
<ConnectWallet size="small" />
</Wrapper>
);
};
@@ -2,7 +2,13 @@
import { COSMOS_KIT_USE_CHAIN } from "@/config";
import { useChain } from "@cosmos-kit/react";
import { Button, type ButtonProps, IconButton, Stack } from "@mui/material";
import {
Box,
Button,
type ButtonProps,
IconButton,
Typography,
} from "@mui/material";
import Cross from "../icons/Cross";
import { WalletAddress } from "./WalletAddress";
import { WalletBalance } from "./WalletBalance";
@@ -27,18 +33,36 @@ const ConnectWallet = ({ ...buttonProps }: ButtonPropsWithOnClick) => {
if (isWalletConnected && !buttonProps.hideAddressAndBalance) {
return (
<Stack direction="row" spacing={3}>
<Box
display={"flex"}
flexDirection={{ xs: "column", sm: "row" }}
alignItems={"center"}
gap={{ xs: 2, sm: 3 }}
>
<WalletBalance />
<WalletAddress address={address} />
<IconButton
size="small"
onClick={async () => {
await handleDisconnectWallet();
}}
>
<Cross />
</IconButton>
</Stack>
<Box>
<IconButton
size="small"
onClick={async () => {
await handleDisconnectWallet();
}}
>
<Box height={24} display={"flex"} alignItems={"center"}>
<Typography
variant="h5"
fontWeight={400}
mr={1}
display={{ sm: "none" }}
sx={{ color: "unset" }}
>
Disconnect
</Typography>
<Cross />
</Box>
</IconButton>
</Box>
</Box>
);
}
+1 -1
View File
@@ -1,5 +1,5 @@
export const COSMOS_KIT_USE_CHAIN =
process.env.NEXT_PUBLIC_COSMOS_KIT_USE_CHAIN || "sandbox";
process.env.NEXT_PUBLIC_COSMOS_KIT_USE_CHAIN || "nyx";
export const NYM_MIXNET_CONTRACT =
process.env.NYM_MIXNET_CONTRACT ||