Skip to content

Commit

Permalink
market page improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
grctest committed Feb 4, 2025
1 parent af1761e commit 19b67b1
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 21 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
"deep-equal": "^2.2.3",
"dompurify": "^3.1.6",
"ecurve": "^1.0.6",
"electron-devtools-installer": "^3.2.0",
"embla-carousel-react": "^8.3.0",
"express": "^4.21.0",
"fuse.js": "^7.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/AccountLists.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ export default function AccountLists(properties) {
{showRowDialog ? (
<DeepLinkDialog
operationNames={["account_whitelist"]}
username={usr.username}
usrChain={usr.chain}
username={usr && usr.username ? usr.username : ""}
usrChain={usr && usr.chain ? usr.chain : "bitshares"}
userID={usr.id}
dismissCallback={setShowRowDialog}
key={`RemovingAccountFromList${mode}${account}`}
Expand Down
8 changes: 5 additions & 3 deletions src/components/CreditDeals.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,11 @@ export default function CreditDeals(properties) {
classnamecontents="text-blue-500"
type="text"
text={res.id.replace("1.22.", "")}
hyperlink={`https://blocksights.info/#/objects/${res.id}${
usr.chain === "bitshares" ? "" : "?network=testnet"
}`}
hyperlink={
usr && usr.chain
? `https://blocksights.info/#/objects/${res.id}${usr.chain === "bitshares" ? "" : "?network=testnet"}`
: ''
}
/>
{t("CreditDeals:with")}
<ExternalLink
Expand Down
20 changes: 19 additions & 1 deletion src/components/Market/LimitOrderCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,23 @@ export default function LimitOrderCard(properties) {
</span>
</span>
</FormControl>

{orderType === "sell" &&
amount &&
price &&
assetABalance &&
parseFloat(assetABalance.replaceAll(",", "")) < parseFloat(amount) ? (
<FormMessage>
{t("LimitOrderCard:sellTotal.requireMore", {
requiredAmount:
amount -
parseFloat(assetABalance.replaceAll(",", "")).toFixed(
assetAData.precision
),
asset: thisAssetA,
})}
</FormMessage>
) : null}
</FormItem>
)}
/>
Expand Down Expand Up @@ -642,7 +659,8 @@ export default function LimitOrderCard(properties) {
</span>
</span>
</FormControl>
{amount &&
{orderType === "buy" &&
amount &&
price &&
assetBBalance &&
parseFloat(assetBBalance.replaceAll(",", "")) < parseFloat(total) ? (
Expand Down
8 changes: 5 additions & 3 deletions src/components/Market/Summary/MyOrderSummary.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo } from "react";
import React, { useMemo, useSyncExternalStore } from "react";
import { useTranslation } from "react-i18next";
import { i18n as i18nInstance, locale } from "@/lib/i18n.js";

Expand All @@ -18,10 +18,12 @@ import { Button } from "@/components/ui/button";
import { HoverCard, HoverCardContent, HoverCardTrigger } from "@/components/ui/hover-card";

import ExternalLink from "@/components/common/ExternalLink.jsx";
import { $currentUser } from "@/stores/users.ts";

export default function MyOrderSummary(properties) {
const { type, assetAData, assetBData, usrLimitOrders } = properties;
const { t, i18n } = useTranslation(locale.get(), { i18n: i18nInstance });
const usr = useSyncExternalStore($currentUser.subscribe, $currentUser.get, () => true);

const filteredUsrLimitOrders = useMemo(
() =>
Expand Down Expand Up @@ -159,9 +161,9 @@ export default function MyOrderSummary(properties) {
classnamecontents=""
type="button"
text={t("MyOrderSummary:viewObjectOnBlocksights")}
hyperlink={`https://blocksights.info/#/objects/${res.id}${
hyperlink={usr && usr.chain ? `https://blocksights.info/#/objects/${res.id}${
usr.chain === "bitshares" ? "" : "?network=testnet"
}`}
}` : ''}
/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/data/locales/da/LimitOrderCard.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"useHighestBid": "Brug højeste bud"
},
"sellAmount": {
"label": "Salgsbeløb",
"label": "Beløb",
"buyDescription": "Mængden af {{asset}} du planlægger at købe",
"sellDescription": "Mængden af {{asset}} du planlægger at sælge",
"provideNewLabel": "Angiv et nyt beløb"
Expand Down
2 changes: 1 addition & 1 deletion src/data/locales/de/LimitOrderCard.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"useHighestBid": "Höchstgebot verwenden"
},
"sellAmount": {
"label": "Verkaufsbetrag",
"label": "Menge",
"buyDescription": "Die Menge an {{asset}} Sie planen einen Kauf",
"sellDescription": "Die Menge an {{asset}} Sie planen zu verkaufen",
"provideNewLabel": "Geben Sie einen neuen Betrag an"
Expand Down
2 changes: 1 addition & 1 deletion src/data/locales/en/LimitOrderCard.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"useHighestBid": "Use highest bid"
},
"sellAmount": {
"label": "Sell Amount",
"label": "Amount",
"buyDescription": "The amount of {{asset}} you plan on buying",
"sellDescription": "The amount of {{asset}} you plan on selling",
"provideNewLabel": "Provide a new amount"
Expand Down
2 changes: 1 addition & 1 deletion src/data/locales/es/LimitOrderCard.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"useHighestBid": "Usar la oferta más alta"
},
"sellAmount": {
"label": "Monto de venta",
"label": "Cantidad",
"buyDescription": "La cantidad de {{asset}} planeas comprar",
"sellDescription": "La cantidad de {{asset}} planeas vender",
"provideNewLabel": "Proporcionar una nueva cantidad"
Expand Down
2 changes: 1 addition & 1 deletion src/data/locales/et/LimitOrderCard.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"useHighestBid": "Kasutage kõrgeimat pakkumist"
},
"sellAmount": {
"label": "Müügisumma",
"label": "Summa",
"buyDescription": "Summa {{asset}} plaanite osta",
"sellDescription": "Summa {{asset}} plaanite müüa",
"provideNewLabel": "Esitage uus summa"
Expand Down
2 changes: 1 addition & 1 deletion src/data/locales/fr/LimitOrderCard.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"useHighestBid": "Utiliser l'enchère la plus élevée"
},
"sellAmount": {
"label": "Montant de la vente",
"label": "Montant",
"buyDescription": "La quantité de {{asset}} tu comptes acheter",
"sellDescription": "La quantité de {{asset}} tu comptes vendre",
"provideNewLabel": "Fournir un nouveau montant"
Expand Down
2 changes: 1 addition & 1 deletion src/data/locales/it/LimitOrderCard.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"useHighestBid": "Utilizza l'offerta più alta"
},
"sellAmount": {
"label": "Importo di vendita",
"label": "Quantità",
"buyDescription": "La quantità di {{asset}} prevedi di acquistare",
"sellDescription": "La quantità di {{asset}} hai intenzione di vendere",
"provideNewLabel": "Fornire un nuovo importo"
Expand Down
2 changes: 1 addition & 1 deletion src/data/locales/ja/LimitOrderCard.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"useHighestBid": "最高入札額を使用する"
},
"sellAmount": {
"label": "販売額",
"label": "",
"buyDescription": "の量 {{asset}} 購入するつもりですか",
"sellDescription": "の量 {{asset}} 販売するつもりですか",
"provideNewLabel": "新しい金額を入力してください"
Expand Down
2 changes: 1 addition & 1 deletion src/data/locales/ko/LimitOrderCard.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"useHighestBid": "최고 입찰가 사용"
},
"sellAmount": {
"label": "판매금액",
"label": "",
"buyDescription": "양 {{asset}} 당신은 구입할 계획입니다",
"sellDescription": "양 {{asset}} 당신은 판매할 계획이에요",
"provideNewLabel": "새로운 금액 제공"
Expand Down
2 changes: 1 addition & 1 deletion src/data/locales/pt/LimitOrderCard.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"useHighestBid": "Usar o lance mais alto"
},
"sellAmount": {
"label": "Valor de venda",
"label": "Quantia",
"buyDescription": "A quantidade de {{asset}} você planeja comprar",
"sellDescription": "A quantidade de {{asset}} você planeja vender",
"provideNewLabel": "Forneça um novo valor"
Expand Down
2 changes: 1 addition & 1 deletion src/data/locales/th/LimitOrderCard.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"useHighestBid": "ใช้ราคาเสนอสูงสุด"
},
"sellAmount": {
"label": "ขายจำนวน",
"label": "จำนวน",
"buyDescription": "จำนวน {{asset}} คุณวางแผนที่จะซื้อ",
"sellDescription": "จำนวน {{asset}} คุณวางแผนที่จะขาย",
"provideNewLabel": "ระบุจำนวนเงินใหม่"
Expand Down

0 comments on commit 19b67b1

Please sign in to comment.