From 9cd94c66183120e134523119fdb2b26069fb773f Mon Sep 17 00:00:00 2001 From: aliraza556 Date: Sat, 31 Aug 2024 13:00:54 +0500 Subject: [PATCH 1/2] Portfolio value change calculation --- packages/features/src/wallet/routes/overview.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/features/src/wallet/routes/overview.tsx b/packages/features/src/wallet/routes/overview.tsx index 0c928730..5df3530b 100644 --- a/packages/features/src/wallet/routes/overview.tsx +++ b/packages/features/src/wallet/routes/overview.tsx @@ -36,16 +36,18 @@ export const OverviewRoute = () => { const priceYesterday = lastMonthPrices?.[lastMonthPrices?.length - 2]?.[1] ?? 0 const dailyPriceDiff = (priceToday - priceYesterday) / priceYesterday - const dailyPriceDiffFiat = Math.abs( - Number(account.minaBalance) * dailyPriceDiff, + const dailyPriceDiffFiat = ( + Number(account.minaBalance) * dailyPriceDiff + ).toFixed(2) + const dailyPriceDiffMina = ( + Number(dailyPriceDiffFiat) / (minaPrice ?? 1) ).toFixed(2) - const dailyPriceDiffMina = Math.abs(dailyPriceDiff).toFixed(2) const chartLabel = typeof currentPriceIndex === "undefined" - ? `${dailyPriceDiff >= 0 ? "+" : "-"}${ + ? `${dailyPriceDiff >= 0 ? "+" : ""}${ useFiatBalance ? dailyPriceDiffFiat : dailyPriceDiffMina } (24h)` - : dayjs(lastMonthPrices[currentPriceIndex]?.[0]).format("MMM d") + : dayjs(lastMonthPrices[currentPriceIndex]?.[0]).format("MMM D") return ( Date: Sat, 31 Aug 2024 13:12:00 +0500 Subject: [PATCH 2/2] format code --- .all-contributorsrc | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 7bd92485..9da03c20 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1,7 +1,5 @@ { - "files": [ - "README.md" - ], + "files": ["README.md"], "imageSize": 100, "commit": false, "commitType": "docs", @@ -12,63 +10,49 @@ "name": "Tomek Marciniak", "avatar_url": "https://avatars.githubusercontent.com/u/16132011?v=4", "profile": "https://github.com/mrcnk", - "contributions": [ - "code" - ] + "contributions": ["code"] }, { "login": "teddyjfpender", "name": "Teddy Pender", "avatar_url": "https://avatars.githubusercontent.com/u/92999717?v=4", "profile": "https://github.com/teddyjfpender", - "contributions": [ - "code" - ] + "contributions": ["code"] }, { "login": "rago4", "name": "Rafał Goławski", "avatar_url": "https://avatars.githubusercontent.com/u/19167236?v=4", "profile": "https://dev.to/rgolawski", - "contributions": [ - "code" - ] + "contributions": ["code"] }, { "login": "mich3lang3lo", "name": "Mariusz", "avatar_url": "https://avatars.githubusercontent.com/u/164676295?v=4", "profile": "https://github.com/mich3lang3lo", - "contributions": [ - "code" - ] + "contributions": ["code"] }, { "login": "aliraza556", "name": "Ali Raza", "avatar_url": "https://avatars.githubusercontent.com/u/87068339?v=4", "profile": "https://github.com/aliraza556", - "contributions": [ - "code" - ] + "contributions": ["code"] }, { "login": "yaodingyd", "name": "Yao Ding", "avatar_url": "https://avatars.githubusercontent.com/u/11392695?v=4", "profile": "https://yaodingyd.github.io/", - "contributions": [ - "code" - ] + "contributions": ["code"] }, { "login": "Myestery", "name": "Chiwetelu Johnpaul Chidera", "avatar_url": "https://avatars.githubusercontent.com/u/49923152?v=4", "profile": "https://www.myestery.com", - "contributions": [ - "code" - ] + "contributions": ["code"] } ], "contributorsPerLine": 7,