* 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
35 lines
798 B
TypeScript
35 lines
798 B
TypeScript
import { t } from '@vegaprotocol/react-helpers';
|
|
import type BigNumber from 'bignumber.js';
|
|
|
|
interface DepositLimitsProps {
|
|
limits: {
|
|
max: BigNumber;
|
|
};
|
|
}
|
|
|
|
export const DepositLimits = ({ limits }: DepositLimitsProps) => {
|
|
let maxLimit = '';
|
|
|
|
if (limits.max.isEqualTo(Infinity)) {
|
|
maxLimit = t('No limit');
|
|
} else if (limits.max.isGreaterThan(1_000_000)) {
|
|
maxLimit = t('1m+');
|
|
} else {
|
|
maxLimit = limits.max.toString();
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<p className="text-ui font-bold">{t('Deposit limits')}</p>
|
|
<table className="w-full text-ui">
|
|
<tbody>
|
|
<tr>
|
|
<th className="text-left font-normal">{t('Maximum')}</th>
|
|
<td className="text-right">{maxLimit}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</>
|
|
);
|
|
};
|