Skip to content

Commit

Permalink
remove profile chain switch
Browse files Browse the repository at this point in the history
  • Loading branch information
eyezick committed Jul 10, 2024
1 parent 964fd4c commit 20b99fd
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/components/Profile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,18 @@ import {
Wallet as WalletIcon,
} from "lucide-react";
import { useState } from "react";
import { useAccount, useBalance, useDisconnect, useSwitchChain } from "wagmi";
import { useAccount, useBalance, useDisconnect } from "wagmi";

import { DEFAULT_CHAIN } from "#/constants";
import AddressMask from "../AddressMask";
import Modal from "../Modal";
import NavLink from "../NavLink";
import CustomRpc from "./CustomRpc";

export default function Profile() {
const { switchChain } = useSwitchChain();
const { chain, address, isConnected } = useAccount();
const { disconnect } = useDisconnect();
const { data: balance } = useBalance({ address: address });

const invalidChain = chain?.id !== DEFAULT_CHAIN.id;
const explorer = chain?.blockExplorers?.default;
const url = `${explorer?.url}/address/${address}`;

Expand Down Expand Up @@ -57,12 +54,6 @@ export default function Profile() {
</div>
</div>
</div>

{invalidChain && (
<Button onClick={() => switchChain({ chainId: DEFAULT_CHAIN.id })} className="w-full">
Switch to {DEFAULT_CHAIN.name} to continue
</Button>
)}
</div>

<CustomRpc />
Expand Down

0 comments on commit 20b99fd

Please sign in to comment.