diff --git a/src/components/Navbar/NetworkSwitcher.tsx b/src/components/Navbar/NetworkSwitcher.tsx index 88cbba07..ebd430a8 100644 --- a/src/components/Navbar/NetworkSwitcher.tsx +++ b/src/components/Navbar/NetworkSwitcher.tsx @@ -1,25 +1,25 @@ -import React from 'react' +import { mdiDeleteOutline, mdiPencilOutline, mdiPlus } from '@mdi/js' import Icon from '@mdi/react' import { + Box, Button, - MenuItem, - Typography, - Select, + Chip, DialogTitle, - useTheme, + IconButton, + MenuItem, MenuList, + Select, Stack, - Box, - Chip, - IconButton, + Typography, + useTheme, } from '@mui/material' -import { mdiDeleteOutline, mdiPencilOutline, mdiPlus } from '@mdi/js' +import React from 'react' +import useNetwork from '../../hooks/useNetwork' import { networkStatusColor, networkStatusName } from '../../utils/networkUtils' -import DialogAnimate from '../Animate/DialogAnimate' import MHidden from '../@material-extend/MHidden' +import DialogAnimate from '../Animate/DialogAnimate' import AddNewNetwork from './AddNewNetwork' import SelectedNetwork from './SelectNetwork' -import useNetwork from '../../hooks/useNetwork' interface NetworkSwitcherProps { handleCloseSidebar?: () => void @@ -90,8 +90,12 @@ export default function NetworkSwitcher({ handleCloseSidebar }: NetworkSwitcherP flexDirection: 'column', alignItems: 'baseline', color: theme.palette.text.primary, + ...(network.name === activeNetwork.name && { cursor: 'auto' }), + }} + onClick={() => { + if (network.name === activeNetwork.name) return + changeNetwork(network.name) }} - onClick={() => changeNetwork(network.name)} > { + if (network.name === activeNetwork.name) return handleChangeNetwork(network.name) }} - sx={{ gap: '.6rem', justifyContent: 'space-between' }} + sx={{ + gap: '.6rem', + justifyContent: 'space-between', + ...(network.name === activeNetwork.name && { cursor: 'auto' }), + }} data-cy={`network-name-${network.name}`} >