aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-12-13 01:29:23 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-12-13 01:29:23 +0800
commit99941972a3965f27b3607a382a476b79722151fc (patch)
treee3bbd6e92d9ad295a1f9277feb38c446f1623ae0 /packages/instant
parent8a5609718aa6e31e30915300e38e47d30d528896 (diff)
downloaddexon-sol-tools-99941972a3965f27b3607a382a476b79722151fc.tar
dexon-sol-tools-99941972a3965f27b3607a382a476b79722151fc.tar.gz
dexon-sol-tools-99941972a3965f27b3607a382a476b79722151fc.tar.bz2
dexon-sol-tools-99941972a3965f27b3607a382a476b79722151fc.tar.lz
dexon-sol-tools-99941972a3965f27b3607a382a476b79722151fc.tar.xz
dexon-sol-tools-99941972a3965f27b3607a382a476b79722151fc.tar.zst
dexon-sol-tools-99941972a3965f27b3607a382a476b79722151fc.zip
Small clean up
Diffstat (limited to 'packages/instant')
-rw-r--r--packages/instant/src/components/order_details.tsx23
1 files changed, 5 insertions, 18 deletions
diff --git a/packages/instant/src/components/order_details.tsx b/packages/instant/src/components/order_details.tsx
index 298bd86c9..cbe36be64 100644
--- a/packages/instant/src/components/order_details.tsx
+++ b/packages/instant/src/components/order_details.tsx
@@ -34,7 +34,7 @@ export class OrderDetails extends React.Component<OrderDetailsProps> {
<Container marginBottom="10px">{this._renderHeader()}</Container>
<OrderDetailsRow
- labelText={this._assetLabelText()}
+ labelText={this._assetAmountLabel()}
primaryValue={this._displayAmountOrPlaceholder(buyQuoteInfo && buyQuoteInfo.assetEthAmount)}
/>
<OrderDetailsRow
@@ -90,7 +90,7 @@ export class OrderDetails extends React.Component<OrderDetailsProps> {
}
}
- private _assetLabelText(): string {
+ private _assetAmountLabel(): string {
const { assetName, baseCurrency } = this.props;
const numTokens = this.props.selectedAssetUnitAmount;
@@ -99,21 +99,17 @@ export class OrderDetails extends React.Component<OrderDetailsProps> {
assetName && assetName !== DEFAULT_UNKOWN_ASSET_NAME && _.isUndefined(numTokens)
? new BigNumber(0)
: numTokens;
-
if (!_.isUndefined(displayNumTokens)) {
let numTokensWithSymbol = displayNumTokens.toString();
-
if (assetName) {
numTokensWithSymbol += ` ${assetName}`;
}
-
const pricePerTokenWei = this._pricePerTokenWei();
if (pricePerTokenWei) {
numTokensWithSymbol += ` @ ${this._displayAmount(baseCurrency, pricePerTokenWei)}`;
}
return numTokensWithSymbol;
}
-
return 'Token Amount';
}
@@ -138,7 +134,6 @@ export class OrderDetails extends React.Component<OrderDetailsProps> {
textStyle.fontColor = ColorOption.primaryColor;
textStyle.fontWeight = 700;
}
-
return <Text {...textStyle}>{choice}</Text>;
}
@@ -154,7 +149,6 @@ export class OrderDetails extends React.Component<OrderDetailsProps> {
>
Order Details
</Text>
-
<Container>
{this._baseCurrencyChoice(BaseCurrency.ETH)}
<Container marginLeft="3px" marginRight="3px" display="inline">
@@ -179,28 +173,21 @@ export class OrderDetailsRow extends React.Component<OrderDetailsRowProps, {}> {
return (
<Container padding="10px 0px" borderTop="1px dashed" borderColor={ColorOption.feintGrey}>
<Flex justify="space-between">
- {this._renderLabel()}
+ <Text fontWeight={this.props.isLabelBold ? 700 : 400} fontColor={ColorOption.grey}>
+ {this.props.labelText}
+ </Text>
<Container>{this._renderValues()}</Container>
</Flex>
</Container>
);
}
- private _renderLabel(): React.ReactNode {
- return (
- <Text fontWeight={this.props.isLabelBold ? 700 : 400} fontColor={ColorOption.grey}>
- {this.props.labelText}
- </Text>
- );
- }
-
private _renderValues(): React.ReactNode {
const secondaryValueNode: React.ReactNode = this.props.secondaryValue && (
<Container marginRight="3px" display="inline-block">
<Text fontColor={ColorOption.lightGrey}>({this.props.secondaryValue})</Text>
</Container>
);
-
return (
<React.Fragment>
{secondaryValueNode}