Skip to content

Commit

Permalink
feat: show profile modal for connect button
Browse files Browse the repository at this point in the history
  • Loading branch information
martonlederer committed Jan 8, 2023
1 parent 110e459 commit bfc84bb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/ConnectButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ChevronDownIcon, UserIcon } from "@iconicicons/react";
import useAddress from "../hooks/active_address";
import useConnection from "../hooks/connection";
import useProfileModal from "../hooks/profile";
import useBalance from "../hooks/balance";
import { formatAddress } from "../utils";
import type { Radius } from "./Provider";
Expand All @@ -26,12 +27,15 @@ export default function ConnectButton({
// ans profile
const ans = useAns();

// profile modal
const profileModal = useProfileModal();

return (
<Wrapper
accent={accent}
onClick={async (e) => {
if (!connected) await connect();
else await disconnect();
else profileModal.setOpen(true);

if (onClick) return onClick(e);
}}
Expand Down

0 comments on commit bfc84bb

Please sign in to comment.