@dynamic-labs/sdk-react-core
Version:
A React SDK for implementing wallet web3 authentication and authorization to your website.
16 lines (14 loc) • 411 B
JavaScript
'use client'
// Derive step state from remaining wallets
const getChainStepState = (chain, chainsLeftToConnect) => {
const isCurrentStep = chain === chainsLeftToConnect[0];
const isStepComplete = !chainsLeftToConnect.includes(chain);
if (isCurrentStep) {
return 'current';
}
if (isStepComplete) {
return 'done';
}
return 'upcoming';
};
export { getChainStepState };