vega-frontend-monorepo/apps/trading/pages/portfolio/withdrawals/withdrawals-container.tsx
botond d4420d6038
Feat/248: portfolio layout (#476)
* feat: add base portfolio layout

* feat: add positions, order list and withdrawals to portfolio page

* feat: add account container to portfolio page plus wallet management improvments

* fix: remove duplication from portfolio page containers

* fix: format and lint

* fix: remove buggy wallet dialog from portfolio page

* fix: deposit e2e test navigation

* fix: temporarily go straight to withdrawal pages

* fix: formatting

* fix: add formatting

Co-authored-by: Joe <joe@vega.xyz>
2022-06-07 10:26:45 +01:00

24 lines
639 B
TypeScript

import orderBy from 'lodash/orderBy';
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
import { useWithdrawals, WithdrawalsTable } from '@vegaprotocol/withdraws';
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 <WithdrawalsTable withdrawals={withdrawals} />;
}}
/>
);
};