Skip to content

Commit

Permalink
add widget states
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-babylonlabs committed Dec 19, 2024
1 parent 4e3c432 commit f2362b7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
Binary file removed public/Keplr.png
Binary file not shown.
Binary file removed public/OKX.png
Binary file not shown.
22 changes: 19 additions & 3 deletions src/app/components/Wallet/Connect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import {
Popover,
Text,
} from "@babylonlabs-io/bbn-core-ui";
import { useWalletConnect } from "@babylonlabs-io/bbn-wallet-connect";
import {
useWalletConnect,
useWidgetState,
} from "@babylonlabs-io/bbn-wallet-connect";
import Image from "next/image";
import { useCallback, useMemo, useRef, useState } from "react";
import { AiOutlineInfoCircle } from "react-icons/ai";
Expand Down Expand Up @@ -44,6 +47,9 @@ export const Connect: React.FC<ConnectProps> = ({
const { bech32Address, connected: bbnConnected } = useCosmosWallet();
const { disconnect } = useWalletConnect();

// Widget states
const { selectedWallets } = useWidgetState();

const [showMenu, setShowMenu] = useState(false);
const { isApiNormal, isGeoBlocked, apiMessage } = useHealthCheck();
const [showDisconnectModal, setShowDisconnectModal] = useState(false);
Expand Down Expand Up @@ -168,8 +174,18 @@ export const Connect: React.FC<ConnectProps> = ({
>
<div className="flex flex-row">
<AvatarGroup max={2} variant="circular">
<Avatar alt="OKX" url="/OKX.png" />
<Avatar alt="Keplr" url="/Keplr.png" />
<Avatar
alt={selectedWallets["BTC"]?.name}
url={selectedWallets["BTC"]?.icon}
size="medium"
className="object-contain bg-white"
/>
<Avatar
alt={selectedWallets["BBN"]?.name}
url={selectedWallets["BBN"]?.icon}
size="medium"
className="object-contain bg-white"
/>
</AvatarGroup>
</div>
<div className="hidden md:flex flex-col text-secondary-contrast">
Expand Down

0 comments on commit f2362b7

Please sign in to comment.