mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-17 17:44:02 -05:00
feat(gui): Clearly mark makers that have no available funds as having no available funds
This commit is contained in:
parent
59f4f8e164
commit
3e86f40448
3 changed files with 34 additions and 2 deletions
|
|
@ -18,11 +18,13 @@ export default function MakerOfferItem({
|
|||
quoteWithAddress: QuoteWithAddress;
|
||||
}) {
|
||||
const { multiaddr, peer_id, quote, version } = quoteWithAddress;
|
||||
const isOutOfLiquidity = quote.max_quantity == 0;
|
||||
|
||||
return (
|
||||
<Paper
|
||||
variant="outlined"
|
||||
sx={{
|
||||
position: "relative",
|
||||
display: "flex",
|
||||
flexDirection: { xs: "column", sm: "row" },
|
||||
gap: 2,
|
||||
|
|
@ -121,6 +123,35 @@ export default function MakerOfferItem({
|
|||
Select
|
||||
</PromiseInvokeButton>
|
||||
</Box>
|
||||
|
||||
{isOutOfLiquidity && (
|
||||
<Box
|
||||
sx={{
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
backdropFilter: "blur(1px)",
|
||||
borderRadius: 2,
|
||||
pointerEvents: "auto",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
variant="h6"
|
||||
sx={{
|
||||
fontWeight: "bold",
|
||||
color: "text.secondary",
|
||||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
Maker has no available funds
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
</Paper>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,10 +39,10 @@ export function sortMakerApprovals(list: SortableQuoteWithAddress[]) {
|
|||
// Prefer makers that have a 'version' attribute
|
||||
// If we don't have a version, we cannot clarify if it's outdated or not
|
||||
(m) => (m.version ? 0 : 1),
|
||||
// Prefer makers that are not outdated
|
||||
(m) => (isMakerVersionOutdated(m.version) ? 1 : 0),
|
||||
// Prefer makers with a minimum quantity > 0
|
||||
(m) => ((m.quote.min_quantity ?? 0) > 0 ? 0 : 1),
|
||||
// Prefer makers that are not outdated
|
||||
(m) => (isMakerVersionOutdated(m.version) ? 1 : 0),
|
||||
// Prefer approvals over actual quotes
|
||||
(m) => (m.request_id ? 0 : 1),
|
||||
// Prefer makers with a lower price
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue