diff options
| author | Oliver <oliver@mohlin.dev> | 2025-07-25 10:59:50 +0200 |
|---|---|---|
| committer | Tobias Järvelöv <tobias.jarvelov@mullvad.net> | 2025-09-22 12:35:43 +0200 |
| commit | 5e2d8957bd305d3ced615e9d8afb1ce35b3157dc (patch) | |
| tree | ded13a7559bb84d5d6f98e62ed460a09b70cb68e /desktop | |
| parent | 681c802b4fba658ddc5ed43a387f923ff1fbbadc (diff) | |
| download | mullvadvpn-5e2d8957bd305d3ced615e9d8afb1ce35b3157dc.tar.xz mullvadvpn-5e2d8957bd305d3ced615e9d8afb1ce35b3157dc.zip | |
Move AutoConnect to separate folder
Diffstat (limited to 'desktop')
4 files changed, 38 insertions, 31 deletions
diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/views/vpn-settings/VpnSettingsView.tsx b/desktop/packages/mullvad-vpn/src/renderer/components/views/vpn-settings/VpnSettingsView.tsx index 52edc25ba0..d611b33b63 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/components/views/vpn-settings/VpnSettingsView.tsx +++ b/desktop/packages/mullvad-vpn/src/renderer/components/views/vpn-settings/VpnSettingsView.tsx @@ -43,7 +43,7 @@ import { NavigationContainer } from '../../NavigationContainer'; import { NavigationListItem } from '../../NavigationListItem'; import { NavigationScrollbars } from '../../NavigationScrollbars'; import SettingsHeader, { HeaderTitle } from '../../SettingsHeader'; -import { AllowLan, AutoStart } from './components'; +import { AllowLan, AutoConnect, AutoStart } from './components'; const StyledInfoButton = styled(InfoButton)({ marginRight: spacings.medium, @@ -131,36 +131,6 @@ export function VpnSettingsView() { ); } -function AutoConnect() { - const autoConnect = useSelector((state) => state.settings.guiSettings.autoConnect); - const { setAutoConnect } = useAppContext(); - - return ( - <AriaInputGroup> - <Cell.Container> - <AriaLabel> - <Cell.InputLabel> - {messages.pgettext('vpn-settings-view', 'Auto-connect')} - </Cell.InputLabel> - </AriaLabel> - <AriaInput> - <Cell.Switch isOn={autoConnect} onChange={setAutoConnect} /> - </AriaInput> - </Cell.Container> - <Cell.CellFooter> - <AriaDescription> - <Cell.CellFooterText> - {messages.pgettext( - 'vpn-settings-view', - 'Automatically connect to a server when the app launches.', - )} - </Cell.CellFooterText> - </AriaDescription> - </Cell.CellFooter> - </AriaInputGroup> - ); -} - function useDns(setting: keyof IDnsOptions['defaultOptions']) { const dns = useSelector((state) => state.settings.dns); const { setDnsOptions } = useAppContext(); diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/views/vpn-settings/components/auto-connect/AutoConnect.tsx b/desktop/packages/mullvad-vpn/src/renderer/components/views/vpn-settings/components/auto-connect/AutoConnect.tsx new file mode 100644 index 0000000000..c3bc1fda8d --- /dev/null +++ b/desktop/packages/mullvad-vpn/src/renderer/components/views/vpn-settings/components/auto-connect/AutoConnect.tsx @@ -0,0 +1,35 @@ +import { messages } from '../../../../../../shared/gettext'; +import { useAppContext } from '../../../../../context'; +import { useSelector } from '../../../../../redux/store'; +import { AriaDescription, AriaInput, AriaInputGroup, AriaLabel } from '../../../../AriaGroup'; +import * as Cell from '../../../../cell'; + +export function AutoConnect() { + const autoConnect = useSelector((state) => state.settings.guiSettings.autoConnect); + const { setAutoConnect } = useAppContext(); + + return ( + <AriaInputGroup> + <Cell.Container> + <AriaLabel> + <Cell.InputLabel> + {messages.pgettext('vpn-settings-view', 'Auto-connect')} + </Cell.InputLabel> + </AriaLabel> + <AriaInput> + <Cell.Switch isOn={autoConnect} onChange={setAutoConnect} /> + </AriaInput> + </Cell.Container> + <Cell.CellFooter> + <AriaDescription> + <Cell.CellFooterText> + {messages.pgettext( + 'vpn-settings-view', + 'Automatically connect to a server when the app launches.', + )} + </Cell.CellFooterText> + </AriaDescription> + </Cell.CellFooter> + </AriaInputGroup> + ); +} diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/views/vpn-settings/components/auto-connect/index.ts b/desktop/packages/mullvad-vpn/src/renderer/components/views/vpn-settings/components/auto-connect/index.ts new file mode 100644 index 0000000000..3e6284c183 --- /dev/null +++ b/desktop/packages/mullvad-vpn/src/renderer/components/views/vpn-settings/components/auto-connect/index.ts @@ -0,0 +1 @@ +export * from './AutoConnect'; diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/views/vpn-settings/components/index.ts b/desktop/packages/mullvad-vpn/src/renderer/components/views/vpn-settings/components/index.ts index d0924d22e1..085052f389 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/components/views/vpn-settings/components/index.ts +++ b/desktop/packages/mullvad-vpn/src/renderer/components/views/vpn-settings/components/index.ts @@ -1,2 +1,3 @@ export * from './allow-lan'; +export * from './auto-connect'; export * from './auto-start'; |
