diff --git a/components/Account/DexOrdersData.js b/components/Account/DexOrdersData.js index 4646f3ed..3c958a6f 100644 --- a/components/Account/DexOrdersData.js +++ b/components/Account/DexOrdersData.js @@ -152,6 +152,130 @@ export default function DexOrdersData({ account, offerList, ledgerTimestamp, set ) }) + // Mobile-specific row format + const mobileOrderRows = sortedOfferList.map((offer, i) => { + const sell = offer.flags?.sell + + // Format the offer details + const offerDetails = ( + <> + {amountFormatWithIcon({ amount: sell ? offer.TakerGets : offer.TakerPays })} + {' for '} + {amountFormatWithIcon({ amount: sell ? offer.TakerPays : offer.TakerGets })} + > + ) + + // Format the rate details + const rateDetails = sell ? ( + typeof offer.TakerGets === 'string' ? ( + <> + 1 {nativeCurrency} = + + {niceNumber(multiply(offer.quality, 1000000), 0, null, 5)}{' '} + {niceCurrency(offer.TakerPays?.currency || nativeCurrency)} + + > + ) : typeof offer.TakerPays === 'string' ? ( + <> + 1 {niceCurrency(offer.TakerGets?.currency)} = + + {niceNumber(divide(offer.quality, 1000000), 0, null, 5)}{' '} + {nativeCurrency} + + > + ) : ( + <> + 1 {niceCurrency(offer.TakerGets?.currency)} = + + {niceNumber(offer.quality, 0, null, 5)}{' '} + {niceCurrency(offer.TakerPays?.currency)} + + > + ) + ) : ( + typeof offer.TakerGets === 'string' ? ( + <> + 1 {niceCurrency(offer.TakerPays?.currency)} ={' '} + + {niceNumber(divide(1, offer.quality * 1000000), 0, null, 2)} {nativeCurrency} + + {fullNiceNumber(divide(1, offer.quality * 1000000))} {nativeCurrency} + + + > + ) : typeof offer.TakerPays === 'string' ? ( + <> + 1 {nativeCurrency} ={' '} + + {niceNumber(divide(1000000, offer.quality), 0, null, 2)} {niceCurrency(offer.TakerGets?.currency)} + + {fullNiceNumber(divide(1000000, offer.quality))} + {niceCurrency(offer.TakerGets?.currency)} + + + > + ) : ( + <> + 1 {niceCurrency(offer.TakerPays?.currency)} ={' '} + + {niceNumber(divide(1, offer.quality), 0, null, 2)} {niceCurrency(offer.TakerGets?.currency)} + + {fullNiceNumber(divide(1, offer.quality))} + {niceCurrency(offer.TakerGets?.currency)} + + + > + ) + ) + + return ( +
# | -Offer | -Rate | -Action | -
---|