diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-10-16 08:33:27 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-10-16 08:33:27 +0800 |
commit | fa18db84d976644270adf0815c73a8d6f40cf9a8 (patch) | |
tree | 89fed6867e70dbe4ed7c9d7d54fc89bb2a9d608f /packages/instant/src/components/order_details.tsx | |
parent | ac3bfdfe5ffc4fc49b88fbad062e1d562987e728 (diff) | |
download | dexon-sol-tools-fa18db84d976644270adf0815c73a8d6f40cf9a8.tar.gz dexon-sol-tools-fa18db84d976644270adf0815c73a8d6f40cf9a8.tar.zst dexon-sol-tools-fa18db84d976644270adf0815c73a8d6f40cf9a8.zip |
Rename OrderDetailsRow to EthAmountRow
Diffstat (limited to 'packages/instant/src/components/order_details.tsx')
-rw-r--r-- | packages/instant/src/components/order_details.tsx | 36 |
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'; |