Documentation
Modals
Claim CSB

Wallet Claim CSB Modal

In order to display WalletClaimCSBModal, you need to connect wallet account first.

Usage

import {
	useIsConnected,
	useClaimCSBStatus,
	useWalletClaimCSBModal,
} from "@crossbell/connect-kit";
 
export function ClaimBtn() {
	const isWalletConnected = useIsConnected("wallet");
	const { isLoading, isEligibleToClaim, errorMsg } = useClaimCSBStatus();
	const { isActive, show, hide } = useWalletClaimCSBModal();
 
	if (!isWalletConnected) return null;
 
	return (
		<button disabled={isLoading || !isEligibleToClaim} onClick={show}>
			{isLoading
				? "Checking Eligibility"
				: isEligibleToClaim
				? "Claim $CSB"
				: errorMsg}
		</button>
	);
}

Return type

OptionTypeDescription
isActivebooleanIndicates whether the modal is activated or not
show() => voidShow modal
hide() => voidHide modal