diff --git a/package.json b/package.json index dfd7727..d459c65 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ghost-dao-interface", "private": true, - "version": "0.0.26", + "version": "0.0.27", "type": "module", "scripts": { "dev": "vite", diff --git a/src/containers/Bond/BondModal.jsx b/src/containers/Bond/BondModal.jsx index 6394698..6a64457 100644 --- a/src/containers/Bond/BondModal.jsx +++ b/src/containers/Bond/BondModal.jsx @@ -113,21 +113,14 @@ export const BondModal = ({ bond, chainId, address, connect }) => { "--" ) : ( ) } /> - } + metric={} /> { ); }; -const TokenPrice = ({ - token, - symbol, - priceInUsd -}) => { +const TokenPrice = ({ priceInUsd }) => { return priceInUsd ? ( - <>{formatCurrency(priceInUsd, 2, symbol)} + <>{formatCurrency(priceInUsd, 2)} ) : ( ); diff --git a/src/containers/Bond/components/BondList.jsx b/src/containers/Bond/components/BondList.jsx index fe60775..58dceab 100644 --- a/src/containers/Bond/components/BondList.jsx +++ b/src/containers/Bond/components/BondList.jsx @@ -95,10 +95,7 @@ const BondCard = ({ bond, secondsTo }) => { {bond.isSoldOut ? ( "--" ) : ( - + )} @@ -191,10 +188,7 @@ const BondRow = ({ bond, secondsTo }) => { {bond.isSoldOut ? ( "--" ) : ( - + )} diff --git a/src/containers/Bond/components/BondPrice.jsx b/src/containers/Bond/components/BondPrice.jsx index 10f5c6f..898d64b 100644 --- a/src/containers/Bond/components/BondPrice.jsx +++ b/src/containers/Bond/components/BondPrice.jsx @@ -1,8 +1,8 @@ -const BondPrice = ({ price, symbol }) => { +import { formatCurrency } from "../../../helpers"; + +const BondPrice = ({ price }) => { return ( - <> - {price.toString({ decimals: 2, format: true, trim: false })} {symbol} - + <>{formatCurrency(price, 2)} ); }; diff --git a/src/hooks/bonds/index.jsx b/src/hooks/bonds/index.jsx index 0b99354..dbf8002 100644 --- a/src/hooks/bonds/index.jsx +++ b/src/hooks/bonds/index.jsx @@ -100,9 +100,9 @@ export const useLiveBonds = (chainId) => { const quoteTokenPerBaseToken = new DecimalBigNumber(marketPrice, 9); const priceInUsd = quoteTokenPerUsd.mul(quoteTokenPerBaseToken); - const discount = quoteTokenPerUsd._value > 0n - ? quoteTokenPerUsd.sub(priceInUsd).div(quoteTokenPerUsd) - : new DecimalBigNumber("0", quoteTokenDecimals); + const discount = baseTokenPerUsd._value > 0n + ? baseTokenPerUsd.sub(priceInUsd).div(baseTokenPerUsd) + : new DecimalBigNumber("0", baseTokenPerUsd._decimals); const capacityInBaseToken = capacityInQuote ? new DecimalBigNumber(marketPrice > 0n ? marketCapacity / marketPrice : 0n, 9) @@ -143,7 +143,7 @@ export const useLiveBonds = (chainId) => { price: { inUsd: priceInUsd, inBaseToken: quoteTokenPerBaseToken, - marketPriceInUsd: quoteTokenPerUsd + marketPriceInUsd: baseTokenPerUsd }, capacity: { inBaseToken: capacityInBaseToken,