04872522d6
* add fixture for markets query * stub graphql requests * re-add assertion for tx hash, stub command/sync requests * refactor to get tests to run with trading page mocked queries * add test wallet credentials * split up markets page from trading page * add portfolio page feature, add market page scenarios * move hasOperationName helper to support/index * fix home-page.feature * fix missing feature step * Minor changes to BDD steps * Use in object syntax to get better type safety on hasOperationName helper function * remove bypass placing orders env var and usage in tests * use UI_Trading_Test wallet publick key in command/sync mock * move public key to cypress env * replace fixtures with generator functions * colocate query generators with queries * add custom commands, add index files * fix dodgy merge, remove duplicate market page feature * make tsconfig for cypress lib match * update tsconfig for explorer e2e so commands using merge work * revert trading step to js Co-authored-by: Joe <joe@vega.xyz>
39 lines
974 B
TypeScript
39 lines
974 B
TypeScript
import { useRouter } from 'next/router';
|
|
import { useMemo } from 'react';
|
|
import { Web3Container } from '../../../components/web3-container';
|
|
import { DepositContainer } from './deposit-container';
|
|
|
|
const Deposit = () => {
|
|
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 (
|
|
<Web3Container>
|
|
{({ ethereumConfig }) => (
|
|
<div className="max-w-[420px] p-24 mx-auto">
|
|
<h1 className="text-h3 mb-12">Deposit</h1>
|
|
<DepositContainer ethereumConfig={ethereumConfig} assetId={assetId} />
|
|
</div>
|
|
)}
|
|
</Web3Container>
|
|
);
|
|
};
|
|
|
|
Deposit.getInitialProps = () => ({
|
|
page: 'deposit',
|
|
});
|
|
|
|
export default Deposit;
|