mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-20 19:06:43 -05:00
refactor(gui): Update MUI to v7 (#383)
* task(gui): update to mui v5 * task(gui): use sx prop instead of system props * task(gui): update to mui v6 and replace makeStyles with sx prop * task(gui): update to mui v7 * task(gui): update react * fix(gui): fix import * task(gui): adjust theme and few components to fix migration introduced styling errors * fix(gui): animation issues with text field animations * fix(gui): remove 'darker' theme and make 'dark' theme the default - with the new update 'dark' theme is already quite dark and therefore a 'darker' theme not necessary - the default theme is set to 'dark' now in settings initialization * feat(tooling): Upgrade dprint to 0.50.0, eslint config, prettier, justfile commands - Upgrade dprint to 0.50.0 - Use sane default eslint config (fairly permissive) - `dprint fmt` now runs prettier for the `src-gui` folder - Added `check_gui_eslint`, `check_gui_tsc` and `check_gui` commands * refactor: fix a few eslint errors * dprint fmt * fix tsc complains * nitpick: small spacing issue --------- Co-authored-by: Binarybaron <binarybaron@protonmail.com> Co-authored-by: Mohan <86064887+binarybaron@users.noreply.github.com>
This commit is contained in:
parent
2ba69ba340
commit
430a22fbf6
169 changed files with 12883 additions and 3950 deletions
|
|
@ -1,29 +1,31 @@
|
|||
import { ExtendedMakerStatus } from "models/apiModel";
|
||||
import { isMakerOnCorrectNetwork, isMakerOutdated } from "./multiAddrUtils";
|
||||
import _ from 'lodash';
|
||||
import _ from "lodash";
|
||||
|
||||
export function sortMakerList(list: ExtendedMakerStatus[]) {
|
||||
return _(list)
|
||||
// Filter out makers that are on the wrong network (testnet / mainnet)
|
||||
.filter(isMakerOnCorrectNetwork)
|
||||
// Sort by criteria
|
||||
.orderBy(
|
||||
[
|
||||
// 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 => (isMakerOutdated(m) ? 1 : 0),
|
||||
// Prefer makers that have a relevancy score
|
||||
m => (m.relevancy == null ? 1 : 0),
|
||||
// Prefer makers with a higher relevancy score
|
||||
m => -(m.relevancy ?? 0),
|
||||
// Prefer makers with a lower price
|
||||
m => m.price
|
||||
],
|
||||
['asc', 'asc', 'asc', 'asc', 'asc']
|
||||
)
|
||||
// Remove duplicate makers
|
||||
.uniqBy(m => m.peerId)
|
||||
.value();
|
||||
}
|
||||
return (
|
||||
_(list)
|
||||
// Filter out makers that are on the wrong network (testnet / mainnet)
|
||||
.filter(isMakerOnCorrectNetwork)
|
||||
// Sort by criteria
|
||||
.orderBy(
|
||||
[
|
||||
// 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) => (isMakerOutdated(m) ? 1 : 0),
|
||||
// Prefer makers that have a relevancy score
|
||||
(m) => (m.relevancy == null ? 1 : 0),
|
||||
// Prefer makers with a higher relevancy score
|
||||
(m) => -(m.relevancy ?? 0),
|
||||
// Prefer makers with a lower price
|
||||
(m) => m.price,
|
||||
],
|
||||
["asc", "asc", "asc", "asc", "asc"],
|
||||
)
|
||||
// Remove duplicate makers
|
||||
.uniqBy((m) => m.peerId)
|
||||
.value()
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue