Skip to content

Commit

Permalink
dont display balances and funding accounts if wallet not connected
Browse files Browse the repository at this point in the history
  • Loading branch information
simke9445 committed Mar 17, 2024
1 parent 5a4e82b commit 7c1fb42
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion apps/warp-protocol/src/pages/balances/Balances.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import { BalanceCard } from './BalanceCard';
import styles from './Balances.module.sass';
import { useBalances } from './useBalances';
import { useTokenListDialog } from './token-list';
import { IfConnected } from 'components/if-connected';
import { NotConnected } from 'components/not-connected';

interface BalancesProps {
fundingAccountAddress: string;
}

export const Balances = (props: BalancesProps) => {
const BalancesInner = (props: BalancesProps) => {
const { fundingAccountAddress } = props;

const { balances, saveAll } = useBalances(fundingAccountAddress);
Expand Down Expand Up @@ -53,3 +55,7 @@ export const Balances = (props: BalancesProps) => {
</Container>
);
};

export const Balances = (props: BalancesProps) => {
return <IfConnected then={<BalancesInner {...props} />} else={<NotConnected />} />;
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import { warp_account_tracker } from '@terra-money/warp-sdk';
import { useState } from 'react';
import { useLocalWallet } from '@terra-money/apps/hooks';
import classNames from 'classnames';
import { IfConnected } from 'components/if-connected';
import { NotConnected } from 'components/not-connected';

interface FundingAccountsProps {}

const accountStatuses = ['taken', 'free'] as warp_account_tracker.AccountStatus[];

export const FundingAccounts = (props: FundingAccountsProps) => {
const FundingAccountsInner = (props: FundingAccountsProps) => {
const [selectedAccountStatus, setSelectedAccountStatus] = useState<warp_account_tracker.AccountStatus>('taken');

const { walletAddress } = useLocalWallet();
Expand Down Expand Up @@ -69,3 +71,7 @@ export const FundingAccounts = (props: FundingAccountsProps) => {
</Container>
);
};

export const FundingAccounts = (props: FundingAccountsProps) => {
return <IfConnected then={<FundingAccountsInner {...props} />} else={<NotConnected />} />;
};

0 comments on commit 7c1fb42

Please sign in to comment.