Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a placeholder if wallet not connected #385

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/nextjs/components/scaffold-stark/Address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useTargetNetwork } from "~~/hooks/scaffold-stark/useTargetNetwork";
import { getBlockExplorerAddressLink } from "~~/utils/scaffold-stark";
import { BlockieAvatar } from "~~/components/scaffold-stark/BlockieAvatar";
import useScaffoldStarkProfile from "~~/hooks/scaffold-stark/useScaffoldStarkProfile";
import ConnectModal from "./CustomConnectButton/ConnectModal";

type AddressProps = {
address?: AddressType;
Expand Down Expand Up @@ -77,7 +78,7 @@ export const Address = ({
}, [fetchedProfile, checkSumAddress, address, format]);

// Skeleton UI
if (!checkSumAddress || isLoading) {
if (isLoading) {
return (
<div className="animate-pulse flex space-x-4">
<div className="rounded-md bg-slate-300 h-6 w-6"></div>
Expand All @@ -88,6 +89,12 @@ export const Address = ({
);
}

if (!checkSumAddress) {
return (
<div className="italic text-base font-bold ">Wallet not connected</div>
);
}

if (!validateChecksumAddress(checkSumAddress)) {
return <span className="text-error">Wrong address</span>;
}
Expand Down
Loading