aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-16 08:33:27 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-16 08:33:27 +0800
commitfa18db84d976644270adf0815c73a8d6f40cf9a8 (patch)
tree89fed6867e70dbe4ed7c9d7d54fc89bb2a9d608f /packages
parentac3bfdfe5ffc4fc49b88fbad062e1d562987e728 (diff)
downloaddexon-sol-tools-fa18db84d976644270adf0815c73a8d6f40cf9a8.tar
dexon-sol-tools-fa18db84d976644270adf0815c73a8d6f40cf9a8.tar.gz
dexon-sol-tools-fa18db84d976644270adf0815c73a8d6f40cf9a8.tar.bz2
dexon-sol-tools-fa18db84d976644270adf0815c73a8d6f40cf9a8.tar.lz
dexon-sol-tools-fa18db84d976644270adf0815c73a8d6f40cf9a8.tar.xz
dexon-sol-tools-fa18db84d976644270adf0815c73a8d6f40cf9a8.tar.zst
dexon-sol-tools-fa18db84d976644270adf0815c73a8d6f40cf9a8.zip
Rename OrderDetailsRow to EthAmountRow
Diffstat (limited to 'packages')
-rw-r--r--packages/instant/src/components/order_details.tsx36
1 files changed, 18 insertions, 18 deletions
diff --git a/packages/instant/src/components/order_details.tsx b/packages/instant/src/components/order_details.tsx
index 66e7e2406..9256d1398 100644
--- a/packages/instant/src/components/order_details.tsx
+++ b/packages/instant/src/components/order_details.tsx
@@ -32,15 +32,15 @@ export class OrderDetails extends React.Component<OrderDetailsProps> {
Order Details
</Text>
</Container>
- <OrderDetailsRow
- name="Token Price"
+ <EthAmountRow
+ rowLabel="Token Price"
ethAmount={ethAssetPrice}
ethUsdPrice={ethUsdPrice}
- shouldConvertEthToUnitAmount={false}
+ isEthAmountInBaseUnits={false}
/>
- <OrderDetailsRow name="Fee" ethAmount={ethTokenFee} ethUsdPrice={ethUsdPrice} />
- <OrderDetailsRow
- name="Total Cost"
+ <EthAmountRow rowLabel="Fee" ethAmount={ethTokenFee} ethUsdPrice={ethUsdPrice} />
+ <EthAmountRow
+ rowLabel="Total Cost"
ethAmount={totalEthAmount}
ethUsdPrice={ethUsdPrice}
shouldEmphasize={true}
@@ -50,29 +50,29 @@ export class OrderDetails extends React.Component<OrderDetailsProps> {
}
}
-export interface OrderDetailsRowProps {
- name: string;
+export interface EthAmountRowProps {
+ rowLabel: string;
ethAmount?: BigNumber;
- shouldConvertEthToUnitAmount?: boolean;
+ isEthAmountInBaseUnits?: boolean;
ethUsdPrice?: BigNumber;
shouldEmphasize?: boolean;
}
-export const OrderDetailsRow: React.StatelessComponent<OrderDetailsRowProps> = ({
- name,
+export const EthAmountRow: React.StatelessComponent<EthAmountRowProps> = ({
+ rowLabel,
ethAmount,
- shouldConvertEthToUnitAmount,
+ isEthAmountInBaseUnits,
ethUsdPrice,
shouldEmphasize,
}) => {
const fontWeight = shouldEmphasize ? 700 : 400;
- const usdFormatter = shouldConvertEthToUnitAmount ? format.ethBaseAmountInUsd : format.ethUnitAmountInUsd;
- const ethFormatter = shouldConvertEthToUnitAmount ? format.ethBaseAmount : format.ethUnitAmount;
+ const usdFormatter = isEthAmountInBaseUnits ? format.ethBaseAmountInUsd : format.ethUnitAmountInUsd;
+ const ethFormatter = isEthAmountInBaseUnits ? format.ethBaseAmount : format.ethUnitAmount;
return (
<Container padding="10px 0px" borderTop="1px dashed" borderColor={ColorOption.feintGrey}>
<Flex justify="space-between">
<Text fontWeight={fontWeight} fontColor={ColorOption.grey}>
- {name}
+ {rowLabel}
</Text>
<Container>
<Container marginRight="3px" display="inline-block">
@@ -87,9 +87,9 @@ export const OrderDetailsRow: React.StatelessComponent<OrderDetailsRowProps> = (
);
};
-OrderDetailsRow.defaultProps = {
+EthAmountRow.defaultProps = {
shouldEmphasize: false,
- shouldConvertEthToUnitAmount: true,
+ isEthAmountInBaseUnits: true,
};
-OrderDetailsRow.displayName = 'OrderDetailsRow';
+EthAmountRow.displayName = 'EthAmountRow';