From d8d818d9535f8613beb1b292f71ef35246f6255a Mon Sep 17 00:00:00 2001 From: devinxl <94832688+devinxl@users.noreply.github.com> Date: Tue, 3 Dec 2024 14:39:21 +0800 Subject: [PATCH] fix(dcellar-web-ui): change the api to get bnb price and several styles (#402) * feat(dcellar-web-ui): change bnb price service * feat(dcellar-web-ui): update csp * fix(dcellar-web-ui): fix loading position & bsc icon * docs(dcellar-web-ui): update changelog --- apps/dcellar-web-ui/CHANGELOG.json | 12 ++++++++++++ apps/dcellar-web-ui/CHANGELOG.md | 9 ++++++++- apps/dcellar-web-ui/package.json | 2 +- .../src/components/common/DCTable/index.tsx | 2 +- apps/dcellar-web-ui/src/facade/common.ts | 4 ++-- apps/dcellar-web-ui/src/middleware.ts | 2 +- .../src/modules/wallet/components/Amount.tsx | 2 +- 7 files changed, 26 insertions(+), 7 deletions(-) diff --git a/apps/dcellar-web-ui/CHANGELOG.json b/apps/dcellar-web-ui/CHANGELOG.json index 6e94e3df..edeaa488 100644 --- a/apps/dcellar-web-ui/CHANGELOG.json +++ b/apps/dcellar-web-ui/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "dcellar-web-ui", "entries": [ + { + "version": "1.9.1", + "tag": "dcellar-web-ui_v1.9.1", + "date": "Tue, 03 Dec 2024 06:37:27 GMT", + "comments": { + "patch": [ + { + "comment": "Change get bnb price api & several styles" + } + ] + } + }, { "version": "1.9.0", "tag": "dcellar-web-ui_v1.9.0", diff --git a/apps/dcellar-web-ui/CHANGELOG.md b/apps/dcellar-web-ui/CHANGELOG.md index d64f93a2..fd64f009 100644 --- a/apps/dcellar-web-ui/CHANGELOG.md +++ b/apps/dcellar-web-ui/CHANGELOG.md @@ -1,6 +1,13 @@ # Change Log - dcellar-web-ui -This log was last generated on Tue, 05 Nov 2024 07:18:43 GMT and should not be manually modified. +This log was last generated on Tue, 03 Dec 2024 06:37:27 GMT and should not be manually modified. + +## 1.9.1 +Tue, 03 Dec 2024 06:37:27 GMT + +### Patches + +- Change get bnb price api & several styles ## 1.9.0 Tue, 05 Nov 2024 07:18:43 GMT diff --git a/apps/dcellar-web-ui/package.json b/apps/dcellar-web-ui/package.json index 264ed681..7cc85987 100644 --- a/apps/dcellar-web-ui/package.json +++ b/apps/dcellar-web-ui/package.json @@ -1,6 +1,6 @@ { "name": "dcellar-web-ui", - "version": "1.9.0", + "version": "1.9.1", "private": false, "scripts": { "dev": "node ./scripts/dev.js -p 3200", diff --git a/apps/dcellar-web-ui/src/components/common/DCTable/index.tsx b/apps/dcellar-web-ui/src/components/common/DCTable/index.tsx index f9619af9..6c19dca3 100644 --- a/apps/dcellar-web-ui/src/components/common/DCTable/index.tsx +++ b/apps/dcellar-web-ui/src/components/common/DCTable/index.tsx @@ -254,7 +254,7 @@ const Container = styled.div<{ rowCursor: string }>` } .ant-spin-nested-loading > div > .ant-spin { - max-height: max-content; + max-height: 400px; } .ant-table-ping-left:not(.ant-table-has-fix-left) .ant-table-container::before { diff --git a/apps/dcellar-web-ui/src/facade/common.ts b/apps/dcellar-web-ui/src/facade/common.ts index cb5eed97..0bfca5b4 100644 --- a/apps/dcellar-web-ui/src/facade/common.ts +++ b/apps/dcellar-web-ui/src/facade/common.ts @@ -77,12 +77,12 @@ export const getObjectInfoAndBucketQuota = async ({ export const getBnbUsdtExchangeRate = async (): Promise => { const [res, error] = await get({ - url: 'https://api.binance.com/api/v3/ticker/price?symbol=BNBUSDT', + url: 'https://bsc-explorer-api.nodereal.io/api/token/getPrice?symbol=bnb', customOptions: { needNotify: false }, }).then(resolve, commonFault); if (error) return BNB_USDT_EXCHANGE_RATE; - return res.price; + return res.data; }; export const getGasFees = async (network?: 'mainnet') => { diff --git a/apps/dcellar-web-ui/src/middleware.ts b/apps/dcellar-web-ui/src/middleware.ts index e0d51fff..e1b8a008 100644 --- a/apps/dcellar-web-ui/src/middleware.ts +++ b/apps/dcellar-web-ui/src/middleware.ts @@ -13,7 +13,7 @@ export function middleware(request: NextRequest) { base-uri 'self'; form-action 'self'; frame-ancestors 'none'; - frame-src 'self' https://*.walletconnect.com https://verify.walletconnect.com; + frame-src 'self' https://*.walletconnect.com https://verify.walletconnect.com https://verify.walletconnect.org; media-src 'self'; manifest-src 'self'; worker-src 'self' blob:; diff --git a/apps/dcellar-web-ui/src/modules/wallet/components/Amount.tsx b/apps/dcellar-web-ui/src/modules/wallet/components/Amount.tsx index bb954c68..0286efd8 100644 --- a/apps/dcellar-web-ui/src/modules/wallet/components/Amount.tsx +++ b/apps/dcellar-web-ui/src/modules/wallet/components/Amount.tsx @@ -265,7 +265,7 @@ export const Amount = ({ /> - + {displayTokenSymbol()}