From bb7a4d4a39ee4bc380a613f16173506fdfaee5f7 Mon Sep 17 00:00:00 2001 From: devinxl Date: Thu, 19 Sep 2024 15:08:26 +0800 Subject: [PATCH] feat(dcellar-web-ui): remove TW and add error notification --- .../src/components/common/DiscontinueBanner/index.tsx | 6 +++--- .../components/WalletConnectProvider.tsx | 6 +++++- apps/dcellar-web-ui/src/modules/bucket/index.tsx | 9 +++++++++ apps/dcellar-web-ui/src/modules/object/index.tsx | 9 +++++++++ 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/apps/dcellar-web-ui/src/components/common/DiscontinueBanner/index.tsx b/apps/dcellar-web-ui/src/components/common/DiscontinueBanner/index.tsx index c2284526..6db7fe61 100644 --- a/apps/dcellar-web-ui/src/components/common/DiscontinueBanner/index.tsx +++ b/apps/dcellar-web-ui/src/components/common/DiscontinueBanner/index.tsx @@ -20,7 +20,7 @@ export const DiscontinueBanner = ({ }) => { return ( {content} diff --git a/apps/dcellar-web-ui/src/context/WalletConnectContext/components/WalletConnectProvider.tsx b/apps/dcellar-web-ui/src/context/WalletConnectContext/components/WalletConnectProvider.tsx index d1a1a52d..81b6840b 100644 --- a/apps/dcellar-web-ui/src/context/WalletConnectContext/components/WalletConnectProvider.tsx +++ b/apps/dcellar-web-ui/src/context/WalletConnectContext/components/WalletConnectProvider.tsx @@ -21,7 +21,11 @@ const config = createConfig( /* WC 2.0 requires a project ID (get one here: https://cloud.walletconnect.com/sign-in) */ walletConnectProjectId: '89848e3205cafe0bf76c91aa1aaa71d0', chains: [bscChain, greenFieldChain], - connectors: [trustWallet(), metaMask(), walletConnect()], + connectors: [ + // trustWallet(), + metaMask(), + walletConnect(), + ], }), ); diff --git a/apps/dcellar-web-ui/src/modules/bucket/index.tsx b/apps/dcellar-web-ui/src/modules/bucket/index.tsx index 59d4dd99..fdf0a903 100644 --- a/apps/dcellar-web-ui/src/modules/bucket/index.tsx +++ b/apps/dcellar-web-ui/src/modules/bucket/index.tsx @@ -7,6 +7,7 @@ import { PageTitle } from '@/components/layout/PageTitle'; import { DiscontinueBanner } from '@/components/common/DiscontinueBanner'; import { BucketOperations } from '@/modules/bucket/components/BucketOperations'; import { GAContextProvider } from '@/context/GAContext'; +import { useAccount } from 'wagmi'; export const BucketPage = () => { const dispatch = useAppDispatch(); @@ -14,6 +15,7 @@ export const BucketPage = () => { const hasDiscontinueBucket = useAppSelector(selectHasDiscontinueBucket(loginAccount)); const documentVisibility = useDocumentVisibility(); + const { connector } = useAccount(); useUpdateEffect(() => { if (documentVisibility !== 'visible') return; @@ -32,6 +34,13 @@ export const BucketPage = () => { + {connector?.id === 'metaMask' && ( + + )} {hasDiscontinueBucket && ( { const dispatch = useAppDispatch(); @@ -43,6 +44,7 @@ export const ObjectsPage = () => { const isBucketDiscontinue = useAppSelector((root) => root.bucket.isBucketDiscontinue); const isBucketMigrating = useAppSelector((root) => root.bucket.isBucketMigrating); const allSpList = useAppSelector((root) => root.sp.allSpList); + const { connector } = useAccount(); const { path } = router.query; const items = path as string[]; @@ -130,6 +132,13 @@ export const ObjectsPage = () => { + {connector?.id === 'metaMask' && ( + + )} {isBucketOwner ? ( ) : (