diff --git a/src/components/header.tsx b/src/components/header.tsx index 1c72b28..fbd0975 100644 --- a/src/components/header.tsx +++ b/src/components/header.tsx @@ -11,8 +11,15 @@ import { useAccount } from "wagmi"; import { useTransfer } from "@/hooks"; import { parseCross } from "@/utils"; import { animated, useTrail } from "@react-spring/web"; +import WalletSelectionModal from "./walletSelectionModal"; export default function Header() { + const [connectModal, setConnectModal] = useState(false); + + const handleClose = useCallback(() => { + setConnectModal(false); + }, []); + const { sender } = useTransfer(); const [showMenu, setShowMenu] = useState(false); @@ -37,7 +44,9 @@ export default function Header() {
- {!sender ? : } + + {!sender ? setConnectModal(true)} /> : } + @@ -71,10 +80,16 @@ export default function Header() {

Asset Hub

-
- -

Connect Wallet

-
+ {!sender ? ( + { + handleCloseMenu(); + setConnectModal(true); + }} + /> + ) : ( + + )}
{data.social.map((item: any) => ( @@ -88,6 +103,7 @@ export default function Header() {
+ ); } diff --git a/src/components/walletButton.tsx b/src/components/walletButton.tsx index f39523e..14aa2a7 100644 --- a/src/components/walletButton.tsx +++ b/src/components/walletButton.tsx @@ -1,27 +1,16 @@ import { useCallback, useState } from "react"; import WalletSelectionModal from "./walletSelectionModal"; -export default function WalletButton() { - const [visible, setVisible] = useState(false); - - const handleClose = useCallback(() => { - setVisible(false); - }, []); - - console.log(visible); - +export default function WalletButton({ openModal }: { openModal: () => void }) { return ( <>
{ - setVisible(true); - }} - className="flex h-[36px] w-fit cursor-pointer items-center justify-center gap-[5px] rounded-[10px] bg-white px-[10px] hover:shadow-lg" + onClick={openModal} + className="flex h-[36px] w-[190px] cursor-pointer items-center gap-[5px] rounded-[10px] bg-white px-[10px] hover:shadow-lg lg:w-fit lg:justify-center" >

Connect Wallet

- ); } diff --git a/src/components/walletSelectionModal.tsx b/src/components/walletSelectionModal.tsx index 08dc602..7cb8beb 100644 --- a/src/components/walletSelectionModal.tsx +++ b/src/components/walletSelectionModal.tsx @@ -59,7 +59,7 @@ export default function WalletSelectionModal({ visible, onClose }: { visible: bo {visible && (
-
+

Select a wallet Type