remove testing ui
This commit is contained in:
parent
444c5427f4
commit
b2355a3fcb
@ -75,7 +75,6 @@ export namespace State {
|
|||||||
goToBank: ButtonHandler;
|
goToBank: ButtonHandler;
|
||||||
goToWallet: ButtonHandler;
|
goToWallet: ButtonHandler;
|
||||||
amountHandler: AmountFieldHandler;
|
amountHandler: AmountFieldHandler;
|
||||||
amounts: any;
|
|
||||||
mode: ToggleHandler;
|
mode: ToggleHandler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,63 +49,6 @@ export function useComponentState(props: Props): RecursiveState<State> {
|
|||||||
);
|
);
|
||||||
const [rawMode, setRawMode] = useState(false);
|
const [rawMode, setRawMode] = useState(false);
|
||||||
|
|
||||||
const [fee, setFee] = useState<any>({});
|
|
||||||
useEffect(() => {
|
|
||||||
if (!amount) return;
|
|
||||||
|
|
||||||
// const type = TransactionType.Deposit
|
|
||||||
[
|
|
||||||
TransactionType.Deposit as const,
|
|
||||||
TransactionType.Withdrawal as const,
|
|
||||||
].forEach((type) => {
|
|
||||||
Promise.all([
|
|
||||||
api.wallet.call(WalletApiOperation.GetPlanForOperation, {
|
|
||||||
type,
|
|
||||||
mode: "effective",
|
|
||||||
account: "payto://iban/DE123",
|
|
||||||
instructedAmount: Amounts.stringify(amount),
|
|
||||||
}),
|
|
||||||
api.wallet.call(WalletApiOperation.GetPlanForOperation, {
|
|
||||||
type,
|
|
||||||
mode: "raw",
|
|
||||||
account: "payto://iban/DE123",
|
|
||||||
instructedAmount: Amounts.stringify(amount),
|
|
||||||
}),
|
|
||||||
]).then(([effective1, raw1]) => {
|
|
||||||
Promise.all([
|
|
||||||
api.wallet.call(WalletApiOperation.GetPlanForOperation, {
|
|
||||||
type,
|
|
||||||
mode: "raw",
|
|
||||||
instructedAmount: effective1.rawAmount,
|
|
||||||
account: "payto://iban/DE123",
|
|
||||||
}),
|
|
||||||
api.wallet.call(WalletApiOperation.GetPlanForOperation, {
|
|
||||||
type,
|
|
||||||
mode: "effective",
|
|
||||||
instructedAmount: raw1.effectiveAmount,
|
|
||||||
account: "payto://iban/DE123",
|
|
||||||
}),
|
|
||||||
]).then(([effective2, raw2]) => {
|
|
||||||
setFee({
|
|
||||||
...fee,
|
|
||||||
[type]: {
|
|
||||||
effective: effective1,
|
|
||||||
raw: raw1,
|
|
||||||
// effective: {
|
|
||||||
// // first: effective1,
|
|
||||||
// // second: effective2,
|
|
||||||
// },
|
|
||||||
// raw: {
|
|
||||||
// // first: raw1,
|
|
||||||
// // second: raw2,
|
|
||||||
// },
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}, [amount?.value, amount?.fraction, rawMode]);
|
|
||||||
|
|
||||||
//FIXME: get this information from wallet
|
//FIXME: get this information from wallet
|
||||||
// eslint-disable-next-line no-constant-condition
|
// eslint-disable-next-line no-constant-condition
|
||||||
const previous: Contact[] = true
|
const previous: Contact[] = true
|
||||||
@ -176,7 +119,6 @@ export function useComponentState(props: Props): RecursiveState<State> {
|
|||||||
return {
|
return {
|
||||||
status: "ready",
|
status: "ready",
|
||||||
error: undefined,
|
error: undefined,
|
||||||
amounts: fee,
|
|
||||||
mode: {
|
mode: {
|
||||||
button: {
|
button: {
|
||||||
onClick: pushAlertOnError(async () => {
|
onClick: pushAlertOnError(async () => {
|
||||||
@ -223,7 +165,6 @@ export function useComponentState(props: Props): RecursiveState<State> {
|
|||||||
return {
|
return {
|
||||||
status: "ready",
|
status: "ready",
|
||||||
error: undefined,
|
error: undefined,
|
||||||
amounts: fee,
|
|
||||||
previous,
|
previous,
|
||||||
mode: {
|
mode: {
|
||||||
button: {
|
button: {
|
||||||
|
@ -194,7 +194,6 @@ export function ReadyView(props: State.Ready): VNode {
|
|||||||
export function ReadyGetView({
|
export function ReadyGetView({
|
||||||
amountHandler,
|
amountHandler,
|
||||||
goToBank,
|
goToBank,
|
||||||
amounts,
|
|
||||||
mode,
|
mode,
|
||||||
goToWallet,
|
goToWallet,
|
||||||
selectCurrency,
|
selectCurrency,
|
||||||
@ -207,7 +206,6 @@ export function ReadyGetView({
|
|||||||
<h1>
|
<h1>
|
||||||
<i18n.Translate>Specify the amount and the origin2</i18n.Translate>
|
<i18n.Translate>Specify the amount and the origin2</i18n.Translate>
|
||||||
</h1>
|
</h1>
|
||||||
<pre>{JSON.stringify(amounts["withdrawal"], undefined, 2)}</pre>
|
|
||||||
<Grid container columns={2} justifyContent="space-between">
|
<Grid container columns={2} justifyContent="space-between">
|
||||||
<AmountField
|
<AmountField
|
||||||
label={i18n.str`Amount`}
|
label={i18n.str`Amount`}
|
||||||
@ -293,7 +291,6 @@ export function ReadyGetView({
|
|||||||
}
|
}
|
||||||
export function ReadySendView({
|
export function ReadySendView({
|
||||||
amountHandler,
|
amountHandler,
|
||||||
amounts,
|
|
||||||
goToBank,
|
goToBank,
|
||||||
goToWallet,
|
goToWallet,
|
||||||
previous,
|
previous,
|
||||||
@ -306,7 +303,6 @@ export function ReadySendView({
|
|||||||
<h1>
|
<h1>
|
||||||
<i18n.Translate>Specify the amount and the destination</i18n.Translate>
|
<i18n.Translate>Specify the amount and the destination</i18n.Translate>
|
||||||
</h1>
|
</h1>
|
||||||
<pre>{JSON.stringify(amounts["deposit"], undefined, 2)}</pre>
|
|
||||||
|
|
||||||
<Grid container columns={2} justifyContent="space-between">
|
<Grid container columns={2} justifyContent="space-between">
|
||||||
<AmountField
|
<AmountField
|
||||||
|
Loading…
Reference in New Issue
Block a user