2022-11-04 10:47:53 +00:00
|
|
|
import { AsyncRenderer, Button } from '@vegaprotocol/ui-toolkit';
|
2022-11-16 14:10:17 +00:00
|
|
|
import { useDepositDialog, DepositsTable } from '@vegaprotocol/deposits';
|
2022-09-06 01:30:13 +00:00
|
|
|
import { useDeposits } from '@vegaprotocol/deposits';
|
2022-07-14 16:12:28 +00:00
|
|
|
import { t } from '@vegaprotocol/react-helpers';
|
|
|
|
|
|
|
|
export const DepositsContainer = () => {
|
2022-09-06 01:30:13 +00:00
|
|
|
const { deposits, loading, error } = useDeposits();
|
2022-11-16 14:10:17 +00:00
|
|
|
const openDepositDialog = useDepositDialog((state) => state.open);
|
2022-09-06 01:30:13 +00:00
|
|
|
|
2022-07-14 16:12:28 +00:00
|
|
|
return (
|
2022-10-12 10:49:13 +00:00
|
|
|
<div className="h-full grid grid-rows-[1fr,min-content]">
|
2022-09-06 01:30:13 +00:00
|
|
|
<div>
|
|
|
|
<AsyncRenderer
|
|
|
|
data={deposits}
|
|
|
|
loading={loading}
|
|
|
|
error={error}
|
|
|
|
render={(data) => {
|
|
|
|
return <DepositsTable deposits={data} />;
|
|
|
|
}}
|
|
|
|
/>
|
2022-07-14 16:12:28 +00:00
|
|
|
</div>
|
2022-10-12 10:49:13 +00:00
|
|
|
<div className="w-full dark:bg-black bg-white absolute bottom-0 h-auto flex justify-end px-[11px] py-2">
|
2022-11-10 00:45:30 +00:00
|
|
|
<Button
|
|
|
|
size="sm"
|
2022-11-16 14:10:17 +00:00
|
|
|
onClick={() => openDepositDialog()}
|
2022-11-10 00:45:30 +00:00
|
|
|
data-testid="deposit-button"
|
|
|
|
>
|
2022-11-04 10:47:53 +00:00
|
|
|
{t('Deposit')}
|
2022-10-12 10:49:13 +00:00
|
|
|
</Button>
|
|
|
|
</div>
|
2022-07-14 16:12:28 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|