vega-frontend-monorepo/apps/trading/pages/portfolio/withdrawals-container.tsx
Matthew Russell ab77e99f96
fix: withdrawals and depsits (#754)
* feat: handle withdrawal limits

* feat: add withdraw limit ui to withdraw form

* chore: lint error

* fix: mock network param query for e2e tests

* fix: wrong translation in tests

* fix: withdrawals test and revert change in text for trade grid elements

* fix: add check for signature length before progressing withdraw
2022-07-14 17:12:28 +01:00

34 lines
1006 B
TypeScript

import orderBy from 'lodash/orderBy';
import { AsyncRenderer, Button } from '@vegaprotocol/ui-toolkit';
import { useWithdrawals, WithdrawalsTable } from '@vegaprotocol/withdraws';
import Link from 'next/link';
export const WithdrawalsContainer = () => {
const { data, loading, error } = useWithdrawals();
return (
<AsyncRenderer
data={data}
loading={loading}
error={error}
render={(data) => {
const withdrawals = orderBy(
data.party?.withdrawals || [],
(w) => new Date(w.createdTimestamp).getTime(),
'desc'
);
return (
<div className="grid grid-cols-[1fr_min-content] gap-12 h-full">
<WithdrawalsTable withdrawals={withdrawals} />
<div className="p-12">
<Link href="/portfolio/withdraw" passHref={true}>
<Button data-testid="start-withdrawal">Withdraw</Button>
</Link>
</div>
</div>
);
}}
/>
);
};