Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev2 #1628

Merged
merged 2 commits into from
Nov 29, 2024
Merged

Dev2 #1628

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading