mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
ui: Swap send/receive for sent bids in active.html.
This commit is contained in:
@@ -1023,6 +1023,7 @@ def js_active(self, url_split, post_string, is_json) -> bytes:
|
|||||||
"amount_to": ci_to.format_amount(amount_to),
|
"amount_to": ci_to.format_amount(amount_to),
|
||||||
"rate": bid_rate,
|
"rate": bid_rate,
|
||||||
"addr_from": bid.bid_addr if bid.was_received else offer.addr_from,
|
"addr_from": bid.bid_addr if bid.was_received else offer.addr_from,
|
||||||
|
"was_sent": bid.was_sent,
|
||||||
}
|
}
|
||||||
|
|
||||||
if offer.swap_type == SwapTypes.XMR_SWAP:
|
if offer.swap_type == SwapTypes.XMR_SWAP:
|
||||||
|
|||||||
@@ -298,7 +298,28 @@ const createSwapTableRow = async (swap) => {
|
|||||||
const timeColor = getTimeStrokeColor(swap.expire_at);
|
const timeColor = getTimeStrokeColor(swap.expire_at);
|
||||||
const fromAmount = parseFloat(swap.amount_from) || 0;
|
const fromAmount = parseFloat(swap.amount_from) || 0;
|
||||||
const toAmount = parseFloat(swap.amount_to) || 0;
|
const toAmount = parseFloat(swap.amount_to) || 0;
|
||||||
|
let send_column = "";
|
||||||
|
let recv_column = "";
|
||||||
|
if (swap.was_sent) {
|
||||||
|
send_column = `
|
||||||
|
<div class="text-sm font-semibold">${fromAmount.toFixed(8)}</div>
|
||||||
|
<div class="text-sm text-gray-500 dark:text-gray-400">${fromSymbol}</div>
|
||||||
|
`
|
||||||
|
recv_column = `
|
||||||
|
<div class="text-sm font-semibold">${toAmount.toFixed(8)}</div>
|
||||||
|
<div class="text-sm text-gray-500 dark:text-gray-400">${toSymbol}</div>
|
||||||
|
`
|
||||||
|
} else {
|
||||||
|
send_column = `
|
||||||
|
<div class="text-sm font-semibold">${toAmount.toFixed(8)}</div>
|
||||||
|
<div class="text-sm text-gray-500 dark:text-gray-400">${toSymbol}</div>
|
||||||
|
`
|
||||||
|
recv_column = `
|
||||||
|
<div class="text-sm font-semibold">${fromAmount.toFixed(8)}</div>
|
||||||
|
<div class="text-sm text-gray-500 dark:text-gray-400">${fromSymbol}</div>
|
||||||
|
|
||||||
|
`
|
||||||
|
}
|
||||||
return `
|
return `
|
||||||
<tr class="relative opacity-100 text-gray-500 dark:text-gray-100 hover:bg-coolGray-200 dark:hover:bg-gray-600" data-bid-id="${swap.bid_id}">
|
<tr class="relative opacity-100 text-gray-500 dark:text-gray-100 hover:bg-coolGray-200 dark:hover:bg-gray-600" data-bid-id="${swap.bid_id}">
|
||||||
<td class="relative w-0 p-0 m-0">
|
<td class="relative w-0 p-0 m-0">
|
||||||
@@ -356,8 +377,7 @@ const createSwapTableRow = async (swap) => {
|
|||||||
<div class="py-3 px-4 text-left">
|
<div class="py-3 px-4 text-left">
|
||||||
<div class="items-center monospace">
|
<div class="items-center monospace">
|
||||||
<div class="pr-2">
|
<div class="pr-2">
|
||||||
<div class="text-sm font-semibold">${fromAmount.toFixed(8)}</div>
|
${send_column}
|
||||||
<div class="text-sm text-gray-500 dark:text-gray-400">${fromSymbol}</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -390,8 +410,7 @@ const createSwapTableRow = async (swap) => {
|
|||||||
<td class="py-0">
|
<td class="py-0">
|
||||||
<div class="py-3 px-4 text-right">
|
<div class="py-3 px-4 text-right">
|
||||||
<div class="items-center monospace">
|
<div class="items-center monospace">
|
||||||
<div class="text-sm font-semibold">${toAmount.toFixed(8)}</div>
|
${recv_column}
|
||||||
<div class="text-sm text-gray-500 dark:text-gray-400">${toSymbol}</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user