Skip to content

Commit

Permalink
fix connect wallet dialog bug
Browse files Browse the repository at this point in the history
  • Loading branch information
simke9445 committed Mar 21, 2024
1 parent a4f9173 commit 013ed38
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useWallet } from '@terra-money/wallet-kit';
import { Button, Text } from 'components/primitives';
import { useState } from 'react';
import { useDialog, DialogProps } from '@terra-money/apps/hooks';
import { Dialog, DialogBody, DialogHeader } from 'components/dialog';
import styles from './ConnectWalletDialog.module.sass';
Expand All @@ -10,15 +9,10 @@ type ConnectWalletDialogProps = {
subtitle?: string;
};

// TODO: filter for supported available wallets
// TODO: add wallet connect

export const ConnectWalletDialog = (props: DialogProps<ConnectWalletDialogProps, boolean>) => {
const { closeDialog, title, subtitle } = props;
const { connect, availableWallets } = useWallet();

const [loading, setLoading] = useState<boolean>(false);

return (
<Dialog className={styles.root}>
<DialogHeader title={title ?? 'Connect your wallet'} onClose={() => closeDialog(undefined, { closeAll: true })} />
Expand All @@ -31,12 +25,11 @@ export const ConnectWalletDialog = (props: DialogProps<ConnectWalletDialogProps,
{availableWallets.map((c, idx) => {
return (
<Button
loading={loading}
className={styles.connection}
key={idx}
onClick={() => {
connect(c.id);
setLoading(true);
closeDialog(undefined);
}}
>
{fixName(c.name)}
Expand Down

0 comments on commit 013ed38

Please sign in to comment.