Skip to content

Commit

Permalink
Merge pull request #1353 from emeraldpay/feature/reorganize-components
Browse files Browse the repository at this point in the history
solution: reorganize components
  • Loading branch information
splix authored Dec 19, 2023
2 parents 2064105 + f397b66 commit cef96fb
Show file tree
Hide file tree
Showing 80 changed files with 64 additions and 1,398 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export class CreateErc20ApproveTx implements Erc20ApproveTxDetails {
if (TokenAmount.is(value)) {
this._amount = value;
} else {
this._amount = this.token.getAmount(value);
this._amount = this.token.getAmount(1).multiply(this.token.getUnits().top.multiplier).multiply(value);
}

this._target = ApproveTarget.MANUAL;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BigAmount, CreateAmount } from '@emeraldpay/bigamount';
import { BigAmount, CreateAmount, Units } from '@emeraldpay/bigamount';
import { WeiAny } from '@emeraldpay/bigamount-crypto';
import BigNumber from 'bignumber.js';
import {
Expand Down Expand Up @@ -156,13 +156,14 @@ export class CreateErc20ConvertTx implements Erc20ConvertTxDetails {
} else {
const { asset, token } = this;

const { units } = this.amount;

let amount: BigAmount;
let units: Units;

if (asset.toLowerCase() === token.address.toLowerCase()) {
amount = token.getAmount(1);
units = token.getUnits();
} else {
units = this.amount.units;
amount = new WeiAny(1, units);
}

Expand Down
8 changes: 1 addition & 7 deletions packages/react-app/src/app/screen/Screen/Screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import ShowMessage from '../../../message/ShowMessage';
import SignMessage from '../../../message/SignMessage';
import ReceiveScreen from '../../../receive/ReceiveScreen';
import Settings from '../../../settings/Settings';
import { BroadcastEthTx } from '../../../transaction/BroadcastEthTx';
import CreateRecoverTransaction from '../../../transaction/CreateRecoverTransaction';
import { CreateTransaction } from '../../../transaction/CreateTransaction';
import { CreateTransaction } from '../../../transaction';
import TxDetails from '../../../transactions/TxDetails';
import WalletDetails from '../../../wallets/WalletDetails';
import WalletInfo from '../../../wallets/WalletInfo';
Expand Down Expand Up @@ -57,12 +55,8 @@ const Screen: React.FC<OwnProps & StateProps> = ({ restoreData, screenItem, term
return <AddHDAddress walletId={screenItem} />;
case screen.Pages.ADDRESS_BOOK:
return <AddressBook />;
case screen.Pages.BROADCAST_TX:
return <BroadcastEthTx data={screenItem} />;
case screen.Pages.CREATE_TX:
return <CreateTransaction {...screenItem} />;
case screen.Pages.CREATE_TX_RECOVER:
return <CreateRecoverTransaction entry={screenItem} />;
case screen.Pages.CREATE_WALLET:
return <CreateWalletScreen />;
case screen.Pages.EDIT_ADDRESS:
Expand Down
41 changes: 0 additions & 41 deletions packages/react-app/src/common/AmountField/AmountField.spec.tsx

This file was deleted.

136 changes: 0 additions & 136 deletions packages/react-app/src/common/AmountField/AmountField.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/react-app/src/common/AmountField/index.ts

This file was deleted.

82 changes: 0 additions & 82 deletions packages/react-app/src/common/BtcConfirm/BtcConfirm.tsx

This file was deleted.

38 changes: 0 additions & 38 deletions packages/react-app/src/common/BtcConfirm/RawTx.tsx

This file was deleted.

Loading

0 comments on commit cef96fb

Please sign in to comment.