Skip to content

Commit

Permalink
fix(ramp): udpates some order details fields to be the correct values…
Browse files Browse the repository at this point in the history
… for sell orders
  • Loading branch information
georgeweiler committed Nov 15, 2023
1 parent 35e5e5c commit c73ab01
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions app/components/UI/Ramp/common/components/OrderDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ interface PropsStage {
pendingDescription?: string;
cryptocurrency?: string;
providerName?: string;
rampType?: OrderOrderTypeEnum;
}

const Row: React.FC = (props) => {
Expand All @@ -90,6 +91,7 @@ const Stage: React.FC<PropsStage> = ({
pendingDescription,
cryptocurrency,
providerName,
rampType,

This comment has been minimized.

Copy link
@wachunei

wachunei Nov 15, 2023

Member

please rename to orderType since rampType makes reference to the flow ramp type and we are not in a flow context

}: PropsStage) => {
const { colors } = useTheme();
const styles = createStyles(colors);
Expand All @@ -106,14 +108,22 @@ const Stage: React.FC<PropsStage> = ({
<Text bold big primary centered>
{strings('fiat_on_ramp_aggregator.order_details.successful')}
</Text>
<Text small centered grey>
{strings('fiat_on_ramp_aggregator.order_details.your')}{' '}
{cryptocurrency ||
strings('fiat_on_ramp_aggregator.order_details.crypto')}{' '}
{strings(
'fiat_on_ramp_aggregator.order_details.available_in_account',
)}
</Text>
{rampType === OrderOrderTypeEnum.Buy ? (
<Text small centered grey>
{strings('fiat_on_ramp_aggregator.order_details.your')}{' '}
{cryptocurrency ||
strings('fiat_on_ramp_aggregator.order_details.crypto')}{' '}
{strings(
'fiat_on_ramp_aggregator.order_details.available_in_account',
)}
</Text>
) : (
<Text small centered grey>
{strings(
'fiat_on_ramp_aggregator.order_details.delayed_bank_transfer',
)}
</Text>
)}
</Group>
</View>
);
Expand Down Expand Up @@ -252,6 +262,7 @@ const OrderDetails: React.FC<Props> = ({
pendingDescription={orderData?.timeDescriptionPending}
cryptocurrency={cryptocurrency}
providerName={providerName}
rampType={order.orderType}
/>
<Group>
<Text bold centered primary style={styles.tokenAmount}>
Expand Down Expand Up @@ -438,7 +449,9 @@ const OrderDetails: React.FC<Props> = ({
<Text small bold primary>
{currencySymbol}
{renderFiat(
amountOut,
order.orderType === OrderOrderTypeEnum.Buy
? amountOut
: (amount as number),
currency,
orderData.fiatCurrency.decimals,
)}
Expand All @@ -464,7 +477,9 @@ const OrderDetails: React.FC<Props> = ({
<Text small bold primary>
{currencySymbol}
{renderFiat(
cryptoFee as number,
order.orderType === OrderOrderTypeEnum.Buy
? (cryptoFee as number)
: orderData.totalFeesFiat,
currency,
orderData.fiatCurrency.decimals,
)}
Expand Down

0 comments on commit c73ab01

Please sign in to comment.