From 1b1d1617a09d8400387e483669652ec89273c9e9 Mon Sep 17 00:00:00 2001 From: Lautaro Petaccio Date: Thu, 4 Jan 2024 17:20:05 -0300 Subject: [PATCH] feat: Add switch network modal loader --- src/containers/Navbar/Navbar.container.tsx | 6 ++++-- src/containers/Navbar/Navbar.tsx | 22 ++++++++++++++-------- src/containers/Navbar/Navbar.types.tsx | 2 ++ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/containers/Navbar/Navbar.container.tsx b/src/containers/Navbar/Navbar.container.tsx index bd03482e..3950e70a 100644 --- a/src/containers/Navbar/Navbar.container.tsx +++ b/src/containers/Navbar/Navbar.container.tsx @@ -5,7 +5,8 @@ import { getAddress, getMana, getChainId, - getAppChainId + getAppChainId, + isSwitchingNetwork } from '../../modules/wallet/selectors' import { isEnabled } from '../../modules/translation/selectors' import { @@ -23,7 +24,8 @@ const mapState = (state: any): MapStateProps => ({ isConnected: isConnected(state), isConnecting: isConnecting(state), hasTranslations: isEnabled(state), - appChainId: getAppChainId(state) + appChainId: getAppChainId(state), + isSwitchingNetwork: isSwitchingNetwork(state) }) const mapDispatch = (dispatch: RootDispatch): MapDispatchProps => ({ diff --git a/src/containers/Navbar/Navbar.tsx b/src/containers/Navbar/Navbar.tsx index ff911521..016e0216 100644 --- a/src/containers/Navbar/Navbar.tsx +++ b/src/containers/Navbar/Navbar.tsx @@ -49,7 +49,7 @@ export default class Navbar extends React.PureComponent { overview: , governance: , transparency: , - grants: , + grants: }, docs: { main: , @@ -92,9 +92,13 @@ export default class Navbar extends React.PureComponent { }) } - render() { - const { appChainId, docsUrl, enablePartialSupportAlert } = this.props + const { + appChainId, + docsUrl, + enablePartialSupportAlert, + isSwitchingNetwork + } = this.props const expectedChainName = getChainName(appChainId) return ( <> @@ -121,10 +125,7 @@ export default class Navbar extends React.PureComponent { onSwitchNetwork={this.handleSwitchNetwork} /> ) : null} - + {isUnsupported ? ( { )} -