vega-frontend-monorepo/apps/trading/client-pages/portfolio/deposits-container.tsx
Bartłomiej Głownia d1b45a65a0
feat(#1812): do not require Ethereum connection to display collateral (#2028)
* feat(#1812): don not require ethereum connection to display collateral

* feat(#1812): amend trading-account e2e tests

* feat(#1812): move Web3ConnectDialog to dialogs container, fix Web3Container childrenOnly option

* feat(#1812): fix withdraw e2e tests

* feat(#1812): reverse DialogsContainer changes, add Web3ConnectUncontrolledDialog

* feat(#1812): wrap WithdrawalDialog with  Web3Container

* feat(#1812): fix deposit dialog handling in ZeroBalanceError

* feat(#1812): fix deposit and withdraw dialog e2e tests

* feat: market proposal selector - fix failing on develop e2e tests

* feat: market proposal selector - fix failing on develop e2e tests

* feat: market proposal selector - fix failing on develop e2e tests

Co-authored-by: maciek <maciek@vegaprotocol.io>
2022-11-16 15:10:17 +01:00

34 lines
1.0 KiB
TypeScript

import { AsyncRenderer, Button } from '@vegaprotocol/ui-toolkit';
import { useDepositDialog, DepositsTable } from '@vegaprotocol/deposits';
import { useDeposits } from '@vegaprotocol/deposits';
import { t } from '@vegaprotocol/react-helpers';
export const DepositsContainer = () => {
const { deposits, loading, error } = useDeposits();
const openDepositDialog = useDepositDialog((state) => state.open);
return (
<div className="h-full grid grid-rows-[1fr,min-content]">
<div>
<AsyncRenderer
data={deposits}
loading={loading}
error={error}
render={(data) => {
return <DepositsTable deposits={data} />;
}}
/>
</div>
<div className="w-full dark:bg-black bg-white absolute bottom-0 h-auto flex justify-end px-[11px] py-2">
<Button
size="sm"
onClick={() => openDepositDialog()}
data-testid="deposit-button"
>
{t('Deposit')}
</Button>
</div>
</div>
);
};