aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components
diff options
context:
space:
mode:
Diffstat (limited to 'packages/website/ts/components')
-rw-r--r--packages/website/ts/components/dialogs/blockchain_err_dialog.tsx14
-rw-r--r--packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx4
-rw-r--r--packages/website/ts/components/dialogs/send_dialog.tsx4
-rw-r--r--packages/website/ts/components/fill_order.tsx6
-rw-r--r--packages/website/ts/components/footer.tsx2
5 files changed, 23 insertions, 7 deletions
diff --git a/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx b/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx
index e71a0f7d1..1c3b7458d 100644
--- a/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx
+++ b/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx
@@ -52,6 +52,8 @@ export class BlockchainErrDialog extends React.Component<BlockchainErrDialogProp
return 'Enable wallet communication';
} else if (this.props.blockchainErr === BlockchainErrs.DisconnectedFromEthereumNode) {
return 'Disconnected from Ethereum network';
+ } else if (this.props.blockchainErr === BlockchainErrs.DefaultTokensNotInTokenRegistry) {
+ return 'Default TokenRegistry tokens missing';
} else {
return 'Unexpected error';
}
@@ -63,6 +65,8 @@ export class BlockchainErrDialog extends React.Component<BlockchainErrDialogProp
return this._renderNoWalletFoundExplanation();
} else if (this.props.blockchainErr === BlockchainErrs.DisconnectedFromEthereumNode) {
return this._renderDisconnectedFromNode();
+ } else if (this.props.blockchainErr === BlockchainErrs.DefaultTokensNotInTokenRegistry) {
+ return this._renderDefaultTokenNotInTokenRegistry();
} else {
return this._renderUnexpectedErrorExplanation();
}
@@ -82,6 +86,16 @@ export class BlockchainErrDialog extends React.Component<BlockchainErrDialogProp
</div>
);
}
+ private _renderDefaultTokenNotInTokenRegistry() {
+ return (
+ <div>
+ The TokenRegistry deployed on your network does not contain the needed default tokens for 0x Portal to
+ operate. Please try one of the supported networks (Mainnet, Kovan, Ropsten, Rinkeby). If on a local
+ Testnet, make sure the TokenRegistry contract is deployed and loaded with some default tokens (i.e WETH
+ & ZRX).
+ </div>
+ );
+ }
private _renderUnexpectedErrorExplanation() {
return <div>We encountered an unexpected error. Please try refreshing the page.</div>;
}
diff --git a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx
index d1bdb447f..42ca1713d 100644
--- a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx
+++ b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx
@@ -37,8 +37,8 @@ export class EthWethConversionDialog extends React.Component<
EthWethConversionDialogState
> {
private _isUnmounted: boolean;
- constructor() {
- super();
+ constructor(props: EthWethConversionDialogProps) {
+ super(props);
this._isUnmounted = false;
this.state = {
shouldShowIncompleteErrs: false,
diff --git a/packages/website/ts/components/dialogs/send_dialog.tsx b/packages/website/ts/components/dialogs/send_dialog.tsx
index d44dd9aab..2af7fd7ac 100644
--- a/packages/website/ts/components/dialogs/send_dialog.tsx
+++ b/packages/website/ts/components/dialogs/send_dialog.tsx
@@ -27,8 +27,8 @@ interface SendDialogState {
}
export class SendDialog extends React.Component<SendDialogProps, SendDialogState> {
- constructor() {
- super();
+ constructor(props: SendDialogProps) {
+ super(props);
this.state = {
recipient: '',
shouldShowIncompleteErrs: false,
diff --git a/packages/website/ts/components/fill_order.tsx b/packages/website/ts/components/fill_order.tsx
index a6144bd6b..ea94e0987 100644
--- a/packages/website/ts/components/fill_order.tsx
+++ b/packages/website/ts/components/fill_order.tsx
@@ -198,11 +198,13 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
symbol: takerToken.symbol,
};
const parsedOrderExpiration = new BigNumber(this.state.parsedOrder.signedOrder.expirationUnixTimestampSec);
- const exchangeRate = orderMakerAmount.div(orderTakerAmount);
let orderReceiveAmount = 0;
if (!_.isUndefined(this.props.orderFillAmount)) {
- const orderReceiveAmountBigNumber = exchangeRate.mul(this.props.orderFillAmount);
+ const orderReceiveAmountBigNumber = orderMakerAmount
+ .times(this.props.orderFillAmount)
+ .dividedBy(orderTakerAmount)
+ .floor();
orderReceiveAmount = this._formatCurrencyAmount(orderReceiveAmountBigNumber, makerToken.decimals);
}
const isUserMaker =
diff --git a/packages/website/ts/components/footer.tsx b/packages/website/ts/components/footer.tsx
index 957ed2044..6c0186ac0 100644
--- a/packages/website/ts/components/footer.tsx
+++ b/packages/website/ts/components/footer.tsx
@@ -45,7 +45,7 @@ interface FooterState {
export class Footer extends React.Component<FooterProps, FooterState> {
constructor(props: FooterProps) {
- super();
+ super(props);
this.state = {
selectedLanguage: props.translate.getLanguage(),
};