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.Sequence} + + {sell ? 'Selling' : 'Buying'} + + + {offer.Account === account?.address ? ( + + setSignRequest({ + request: { + TransactionType: 'OfferCancel', + OfferSequence: offer.Sequence + } + }) + } + className="red tooltip" + > + + Cancel + + ) : ( + + + Cancel + + )} + +
+ +
+ Offer: + {offerDetails} +
+ +
+ Rate: + {rateDetails} +
+ + + ) + }) + return ( <> @@ -222,13 +346,7 @@ export default function DexOrdersData({ account, offerList, ledgerTimestamp, set
- - - - - - - {orderRows} + {mobileOrderRows}
#OfferRateAction

diff --git a/styles/pages/account.scss b/styles/pages/account.scss index 7e9bfe77..f25551ea 100644 --- a/styles/pages/account.scss +++ b/styles/pages/account.scss @@ -89,5 +89,59 @@ width: 100%; padding: 0; } + + // Mobile DEX orders styling + .mobile-dex-row { + td { + padding: 12px 8px; + vertical-align: top; + } + } + + .mobile-dex-line1 { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 8px; + flex-wrap: wrap; + gap: 8px; + } + + .mobile-dex-sequence { + font-weight: bold; + color: var(--text-secondary); + font-size: 12px; + } + + .mobile-dex-type { + font-weight: bold; + font-size: 16px; + flex: 1; + text-align: center; + margin: 0 8px; + } + + .mobile-dex-action { + display: flex; + align-items: center; + } + + .mobile-dex-line2 { + margin-bottom: 6px; + font-size: 14px; + line-height: 1.4; + } + + .mobile-dex-line3 { + font-size: 13px; + color: var(--text-secondary); + line-height: 1.3; + } + + .mobile-dex-label { + font-weight: bold; + color: var(--text-primary); + margin-right: 4px; + } } }