From 2fc96a233be50d16625a479c2aeb60302e747d0d Mon Sep 17 00:00:00 2001 From: aidencao Date: Thu, 31 Oct 2024 18:49:16 +0800 Subject: [PATCH] feat(canonical-bridge-widget): Update widget ui --- .release/.changeset/dirty-shoes-tap.md | 5 +++++ .release/.changeset/pre.json | 1 + packages/canonical-bridge-widget/CHANGELOG.md | 6 ++++++ packages/canonical-bridge-widget/package.json | 2 +- .../transfer/components/ReceiveInfo/index.tsx | 12 ++++++++++-- 5 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 .release/.changeset/dirty-shoes-tap.md diff --git a/.release/.changeset/dirty-shoes-tap.md b/.release/.changeset/dirty-shoes-tap.md new file mode 100644 index 00000000..f14199cb --- /dev/null +++ b/.release/.changeset/dirty-shoes-tap.md @@ -0,0 +1,5 @@ +--- +"@bnb-chain/canonical-bridge-widget": patch +--- + +Update widget ui diff --git a/.release/.changeset/pre.json b/.release/.changeset/pre.json index 3ecc9307..d71c88c4 100644 --- a/.release/.changeset/pre.json +++ b/.release/.changeset/pre.json @@ -8,6 +8,7 @@ "changesets": [ "chilled-lizards-compare", "cyan-boxes-judge", + "dirty-shoes-tap", "early-drinks-bathe", "fuzzy-houses-complain", "long-ears-press", diff --git a/packages/canonical-bridge-widget/CHANGELOG.md b/packages/canonical-bridge-widget/CHANGELOG.md index 05978ca4..09c1317d 100644 --- a/packages/canonical-bridge-widget/CHANGELOG.md +++ b/packages/canonical-bridge-widget/CHANGELOG.md @@ -1,5 +1,11 @@ # @bnb-chain/canonical-bridge-widget +## 0.3.2-alpha.17 + +### Patch Changes + +- Update widget ui + ## 0.3.2-alpha.16 ### Patch Changes diff --git a/packages/canonical-bridge-widget/package.json b/packages/canonical-bridge-widget/package.json index 84b91997..a3f460c3 100644 --- a/packages/canonical-bridge-widget/package.json +++ b/packages/canonical-bridge-widget/package.json @@ -1,6 +1,6 @@ { "name": "@bnb-chain/canonical-bridge-widget", - "version": "0.3.2-alpha.16", + "version": "0.3.2-alpha.17", "description": "canonical bridge widget", "author": "bnb-chain", "private": false, diff --git a/packages/canonical-bridge-widget/src/modules/transfer/components/ReceiveInfo/index.tsx b/packages/canonical-bridge-widget/src/modules/transfer/components/ReceiveInfo/index.tsx index fccf078b..711217da 100644 --- a/packages/canonical-bridge-widget/src/modules/transfer/components/ReceiveInfo/index.tsx +++ b/packages/canonical-bridge-widget/src/modules/transfer/components/ReceiveInfo/index.tsx @@ -138,8 +138,16 @@ export const ReceiveInfo = ({ onOpen }: ReceiveInfoProps) => { const isHideSection = useMemo(() => { // no receive amount and some routes are displayed - return !Number(sendValue); - }, [sendValue]); + if (!Number(sendValue)) return true; + if (isGlobalFeeLoading) return false; + return ( + !Number(sendValue) || + (!isBase && + estimatedAmount && + !Object.values(estimatedAmount).every((element) => element === undefined) && + !receiveAmt) + ); + }, [sendValue, estimatedAmount, receiveAmt, isGlobalFeeLoading, isBase]); const isHideRouteButton = useMemo(() => { return (