diff options
| author | Oskar <oskar@mullvad.net> | 2024-10-22 15:32:24 +0200 |
|---|---|---|
| committer | Oskar <oskar@mullvad.net> | 2024-10-22 15:32:24 +0200 |
| commit | 1ec8c9d6c4dc799fb0c6479cdc9dad438bf37129 (patch) | |
| tree | 43caf1e9884496f64c2333648c16381eaa1cf18a /gui/src/renderer/components/main-view | |
| parent | 6533665d1fdf9a97e6ea1e36f01ee2f293b4338c (diff) | |
| parent | cf62ffdd17eac7958977895f098742c704aa3047 (diff) | |
| download | mullvadvpn-1ec8c9d6c4dc799fb0c6479cdc9dad438bf37129.tar.xz mullvadvpn-1ec8c9d6c4dc799fb0c6479cdc9dad438bf37129.zip | |
Merge branch 'add-react-linter-rules'
Diffstat (limited to 'gui/src/renderer/components/main-view')
4 files changed, 9 insertions, 8 deletions
diff --git a/gui/src/renderer/components/main-view/ConnectionActionButton.tsx b/gui/src/renderer/components/main-view/ConnectionActionButton.tsx index ad579da671..437fa93321 100644 --- a/gui/src/renderer/components/main-view/ConnectionActionButton.tsx +++ b/gui/src/renderer/components/main-view/ConnectionActionButton.tsx @@ -31,7 +31,7 @@ function ConnectButton(props: Partial<Parameters<typeof SmallButton>[0]>) { const error = e as Error; log.error(`Failed to connect the tunnel: ${error.message}`); } - }, []); + }, [connectTunnel]); return ( <StyledConnectionButton color={SmallButtonColor.green} onClick={onConnect} {...props}> @@ -51,7 +51,7 @@ function DisconnectButton() { const error = e as Error; log.error(`Failed to disconnect the tunnel: ${error.message}`); } - }, []); + }, [disconnectTunnel]); const displayAsCancel = tunnelState !== 'connected'; diff --git a/gui/src/renderer/components/main-view/ConnectionPanel.tsx b/gui/src/renderer/components/main-view/ConnectionPanel.tsx index 5b4e576f76..34e98abeea 100644 --- a/gui/src/renderer/components/main-view/ConnectionPanel.tsx +++ b/gui/src/renderer/components/main-view/ConnectionPanel.tsx @@ -1,7 +1,7 @@ import { useCallback, useEffect } from 'react'; import styled from 'styled-components'; -import { useBoolean } from '../../lib/utilityHooks'; +import { useBoolean } from '../../lib/utility-hooks'; import { useSelector } from '../../redux/store'; import CustomScrollbars from '../CustomScrollbars'; import { BackAction } from '../KeyboardNavigation'; diff --git a/gui/src/renderer/components/main-view/FeatureIndicators.tsx b/gui/src/renderer/components/main-view/FeatureIndicators.tsx index 2d7914fd87..5b7e60ade0 100644 --- a/gui/src/renderer/components/main-view/FeatureIndicators.tsx +++ b/gui/src/renderer/components/main-view/FeatureIndicators.tsx @@ -5,7 +5,7 @@ import styled from 'styled-components'; import { colors, strings } from '../../../config.json'; import { FeatureIndicator } from '../../../shared/daemon-rpc-types'; import { messages } from '../../../shared/gettext'; -import { useStyledRef } from '../../lib/utilityHooks'; +import { useStyledRef } from '../../lib/utility-hooks'; import { useSelector } from '../../redux/store'; import { tinyText } from '../common-styles'; import { InfoIcon } from '../InfoButton'; @@ -169,6 +169,7 @@ export default function FeatureIndicators(props: FeatureIndicatorsProps) { // Place the ellipsis at the end of the last visible indicator. const left = lastVisibleIndicatorRect.right - containerRect.left; + // eslint-disable-next-line react-compiler/react-compiler ellipsisRef.current.style.left = `${left}px`; ellipsisRef.current.style.visibility = 'visible'; diff --git a/gui/src/renderer/components/main-view/SelectLocationButton.tsx b/gui/src/renderer/components/main-view/SelectLocationButton.tsx index 30b132a84e..50508a3192 100644 --- a/gui/src/renderer/components/main-view/SelectLocationButton.tsx +++ b/gui/src/renderer/components/main-view/SelectLocationButton.tsx @@ -33,7 +33,7 @@ export default function SelectLocationButtons() { } function SelectLocationButton(props: MultiButtonCompatibleProps) { - const history = useHistory(); + const { push } = useHistory(); const tunnelState = useSelector((state) => state.connection.status.state); const relaySettings = useSelector((state) => state.settings.relaySettings); @@ -46,8 +46,8 @@ function SelectLocationButton(props: MultiButtonCompatibleProps) { ); const onSelectLocation = useCallback(() => { - history.push(RoutePath.selectLocation, { transition: transitions.show }); - }, [history.push]); + push(RoutePath.selectLocation, { transition: transitions.show }); + }, [push]); return ( <StyledSmallButton @@ -129,7 +129,7 @@ function ReconnectButton(props: MultiButtonCompatibleProps) { const error = e as Error; log.error(`Failed to reconnect the tunnel: ${error.message}`); } - }, []); + }, [reconnectTunnel]); return ( <StyledReconnectButton |
