+
+
+
+
+
+
Wallet Connected
+
+ bc1pnT
+ |
+ bbn170
-
- {showMenu && (
-
+
+
- )}
-
- ) : (
-
-
-
- Connect Wallets
-
- {!isApiNormal && renderApiNotAvailableTooltip()}
+
+
+
+
);
};
diff --git a/src/app/components/Connect/ConnectedSmall.tsx b/src/app/components/Connect/ConnectedSmall.tsx
index 0559e3ae..5ac6337d 100644
--- a/src/app/components/Connect/ConnectedSmall.tsx
+++ b/src/app/components/Connect/ConnectedSmall.tsx
@@ -1,16 +1,14 @@
-import { useRef, useState } from "react";
-import { FaBitcoin } from "react-icons/fa";
-import { IoMdClose } from "react-icons/io";
+import { useWalletConnect } from "@babylonlabs-io/bbn-wallet-connect";
+import Image from "next/image";
+import { useEffect, useRef, useState } from "react";
import { useOnClickOutside } from "usehooks-ts";
+import keplr from "@/app/assets/Keplr.png";
+import okx from "@/app/assets/OKX.png";
+import { useBTCWallet } from "@/app/context/wallet/BTCWalletProvider";
+import { useCosmosWallet } from "@/app/context/wallet/CosmosWalletProvider";
import { useAppState } from "@/app/state";
import { getNetworkConfig } from "@/config/network.config";
-import { satoshiToBtc } from "@/utils/btc";
-import { maxDecimals } from "@/utils/maxDecimals";
-import { trim } from "@/utils/trim";
-
-import { Hash } from "../Hash/Hash";
-import { LoadingSmall } from "../Loading/Loading";
interface ConnectedSmallProps {
loading?: boolean;
@@ -22,87 +20,107 @@ interface ConnectedSmallProps {
export const ConnectedSmall: React.FC
= ({
loading = false,
- connected,
address,
btcWalletBalanceSat,
onDisconnect,
}) => {
const { ordinalsExcluded, includeOrdinals, excludeOrdinals } = useAppState();
+ const { connected } = useWalletConnect();
+ const btc = useBTCWallet();
+ const bbn = useCosmosWallet();
const [showMenu, setShowMenu] = useState(false);
const handleClickOutside = () => {
setShowMenu(false);
};
+ useEffect(() => {
+ const action = async () => {
+ console.log({ btc, network: await btc.getNetwork(), bbn });
+ };
+ action();
+ }, [bbn, btc]);
+
const ref = useRef(null);
useOnClickOutside(ref, handleClickOutside);
const { coinName } = getNetworkConfig();
+ if (!connected) {
+ return null;
+ }
+
return (
- connected && (
-
-
setShowMenu(!showMenu)}
- >
-
-
-
- {typeof btcWalletBalanceSat === "number" && (
-
-
- {maxDecimals(satoshiToBtc(btcWalletBalanceSat), 8)}{" "}
- {coinName}
-
-
- )}
- {loading &&
}
-
-
-
- {trim(address)}
-
-
- {showMenu && (
-
-
-
Settings
- setShowMenu(false)}
- >
-
-
-
-
-
-
-
-
-
-
{
- setShowMenu(false);
- onDisconnect();
- }}
- >
- Disconnect
-
-
- )}
-
- )
+
+
+
+
);
+
+ // return (
+ // connected && (
+ //
+ //
setShowMenu(!showMenu)}
+ // >
+ //
+ //
+ //
+ // {typeof btcWalletBalanceSat === "number" && (
+ //
+ //
+ // {maxDecimals(satoshiToBtc(btcWalletBalanceSat), 8)}{" "}
+ // {coinName}
+ //
+ //
+ // )}
+ // {loading &&
}
+ //
+ //
+ //
+ // {trim(address)}
+ //
+ //
+ // {showMenu && (
+ //
+ //
+ //
Settings
+ // setShowMenu(false)}
+ // >
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+ //
{
+ // setShowMenu(false);
+ // onDisconnect();
+ // }}
+ // >
+ // Disconnect
+ //
+ //
+ // )}
+ //
+ // )
+ // );
};
diff --git a/src/app/components/Connect/Menu.tsx b/src/app/components/Connect/Menu.tsx
new file mode 100644
index 00000000..4c788a98
--- /dev/null
+++ b/src/app/components/Connect/Menu.tsx
@@ -0,0 +1,81 @@
+import { Text } from "@babylonlabs-io/bbn-core-ui";
+import { useWalletConnect } from "@babylonlabs-io/bbn-wallet-connect";
+import Image from "next/image";
+
+import bitcoin from "@/app/assets/bitcoin.png";
+import bbnIcon from "@/app/assets/icon-black.svg";
+import { useBTCWallet } from "@/app/context/wallet/BTCWalletProvider";
+import { useAppState } from "@/app/state";
+
+import { Hash } from "../Hash/Hash";
+import { ThemeToggle } from "../ThemeToggle/ThemeToggle";
+import { Toggle } from "../Toggle/Toggle";
+
+interface MenuProps {
+ open: boolean;
+ onClose: () => void;
+}
+
+export const Menu: React.FC = ({ open, onClose }) => {
+ const { ordinalsExcluded, includeOrdinals, excludeOrdinals } = useAppState();
+ const { disconnect } = useWalletConnect();
+ const { address } = useBTCWallet();
+
+ if (!open) {
+ return null;
+ }
+
+ return (
+
+
+
+
+ Not using Inscriptions
+
+
+
+
+
+
+
+
+
+
+ Babylon Chain
+
+
+
+
+
+
+ {
+ onClose();
+ disconnect();
+ }}
+ >
+ Disconnect Wallets
+
+
+
+
+
+
+
+ );
+};
diff --git a/src/app/components/Header/Header.tsx b/src/app/components/Header/Header.tsx
index 57fe344c..86483353 100644
--- a/src/app/components/Header/Header.tsx
+++ b/src/app/components/Header/Header.tsx
@@ -1,15 +1,12 @@
import { useWalletConnect } from "@babylonlabs-io/bbn-wallet-connect";
-import { twJoin } from "tailwind-merge";
import { useBTCWallet } from "@/app/context/wallet/BTCWalletProvider";
import { useAppState } from "@/app/state";
import { shouldDisplayTestingMsg } from "@/config";
-import { ConnectedSmall } from "../Connect/ConnectedSmall";
import { ConnectSmall } from "../Connect/ConnectSmall";
import { Logo } from "../Logo/Logo";
import { TestingInfo } from "../TestingInfo/TestingInfo";
-import { ThemeToggle } from "../ThemeToggle/ThemeToggle";
export const Header = () => {
const { connected, disconnect, open } = useWalletConnect();
@@ -37,22 +34,22 @@ export const Header = () => {
btcWalletBalanceSat={totalBalance}
onDisconnect={disconnect}
/>
-
-
-