Skip to content

Commit

Permalink
feat: show status of connect modal in example dApp (#1541)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSinclair authored Oct 11, 2023
1 parent 02d986a commit cd5abee
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/example/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ type AccountStatus = ExtractString<ConnectButtonProps['accountStatus']>;
type ChainStatus = ExtractString<ConnectButtonProps['chainStatus']>;

const Example = ({ authEnabled }: AppContextProps) => {
const { openAccountModal } = useAccountModal();
const { openChainModal } = useChainModal();
const { openConnectModal } = useConnectModal();
const { openAccountModal, accountModalOpen } = useAccountModal();
const { openChainModal, chainModalOpen } = useChainModal();
const { openConnectModal, connectModalOpen } = useConnectModal();
const { address, isConnected: isWagmiConnected } = useAccount();
const { status } = useSession();

Expand Down Expand Up @@ -260,21 +260,25 @@ const Example = ({ authEnabled }: AppContextProps) => {
onClick={openConnectModal}
type="button"
>
Open connect modal
{connectModalOpen
? 'Connect modal opened'
: 'Open connect modal'}
</button>
<button
disabled={!openChainModal}
onClick={openChainModal}
type="button"
>
Open chain modal
{chainModalOpen ? 'Chain modal opened' : 'Open chain modal'}
</button>
<button
disabled={!openAccountModal}
onClick={openAccountModal}
type="button"
>
Open account modal
{accountModalOpen
? 'Account modal opened'
: 'Open account modal'}
</button>
</div>
</div>
Expand Down

2 comments on commit cd5abee

@vercel
Copy link

@vercel vercel bot commented on cd5abee Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on cd5abee Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.