Skip to content

Commit

Permalink
Merge pull request #1628 from QuickSwap/dev2
Browse files Browse the repository at this point in the history
Dev2
  • Loading branch information
sameepsi authored Nov 29, 2024
2 parents 72fddeb + fe7a2f0 commit 169a973
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/components/Header/NetworkSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ export const NetworkSelection: React.FC = () => {
</small>
{openNetworkSelection ? <KeyboardArrowUp /> : <KeyboardArrowDown />}
</Box>
{openNetworkSelection && <NetworkSelectionDropdown />}
{openNetworkSelection && (
<NetworkSelectionDropdown
setOpenNetworkSelection={setOpenNetworkSelection}
/>
)}
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import CustomTabSwitch from 'components/v3/CustomTabSwitch';
import ActiveDotImage from 'assets/images/chainActiveDot.png';
import { useSwitchNetwork } from '@web3modal/ethers5/react';

const NetworkSelectionDropdown: React.FC = () => {
const NetworkSelectionDropdown: React.FC<{
setOpenNetworkSelection: (isOpen: boolean) => void;
}> = ({ setOpenNetworkSelection }) => {
const { t } = useTranslation();
const arcxSdk = useArcxAnalytics();
const { chainId, account, currentChainId } = useActiveWeb3React();
Expand Down Expand Up @@ -57,6 +59,7 @@ const NetworkSelectionDropdown: React.FC = () => {
if (!currentChainId) {
window.location.reload();
}
setOpenNetworkSelection(false);
},
[account, arcxSdk, currentChainId, switchNetwork],
);
Expand Down

0 comments on commit 169a973

Please sign in to comment.