1cdea0b2e8
* feat(web3): make web3 container component reusable * feat(console-lite): add deposits tab to portfolio page * fix(console-lite): linting errors * fix(console-lite): pr comments * fix(console-lite): use enums for network vars
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
import { useRouter } from 'next/router';
|
|
import { useMemo } from 'react';
|
|
import { WithdrawPageContainer } from './withdraw-page-container';
|
|
import { VegaWalletContainer } from '../../../components/vega-wallet-container';
|
|
import { Web3Container } from '@vegaprotocol/web3';
|
|
import { t } from '@vegaprotocol/react-helpers';
|
|
|
|
const Withdraw = () => {
|
|
const { query } = useRouter();
|
|
|
|
// AssetId can be specified in the query string to allow link to deposit a particular asset
|
|
const assetId = useMemo(() => {
|
|
if (query.assetId && Array.isArray(query.assetId)) {
|
|
return undefined;
|
|
}
|
|
|
|
if (Array.isArray(query.assetId)) {
|
|
return undefined;
|
|
}
|
|
|
|
return query.assetId;
|
|
}, [query]);
|
|
|
|
return (
|
|
<VegaWalletContainer>
|
|
<Web3Container>
|
|
<div className="max-w-[420px] p-8 mx-auto">
|
|
<h1 className="text-2xl mb-4">{t('Withdraw')}</h1>
|
|
<WithdrawPageContainer assetId={assetId} />
|
|
</div>
|
|
</Web3Container>
|
|
</VegaWalletContainer>
|
|
);
|
|
};
|
|
|
|
export default Withdraw;
|