diff options
| author | Oskar <oskar@mullvad.net> | 2024-11-05 07:57:08 +0100 |
|---|---|---|
| committer | Oskar <oskar@mullvad.net> | 2024-11-14 16:43:18 +0100 |
| commit | 84f14d79c4f0dde73337820ec94ba8ff928a3797 (patch) | |
| tree | ce468658e5ba7b0a74950c7ad1b09b3a4d00520b /gui/src/renderer/redux/userinterface | |
| parent | e3ce0eb5cd0610dbff6ec98cb8cb388415c74bf6 (diff) | |
| download | mullvadvpn-84f14d79c4f0dde73337820ec94ba8ff928a3797.tar.xz mullvadvpn-84f14d79c4f0dde73337820ec94ba8ff928a3797.zip | |
Move gui directory to desktop/packages/mullvad-vpn
Diffstat (limited to 'gui/src/renderer/redux/userinterface')
| -rw-r--r-- | gui/src/renderer/redux/userinterface/actions.ts | 176 | ||||
| -rw-r--r-- | gui/src/renderer/redux/userinterface/reducers.ts | 94 |
2 files changed, 0 insertions, 270 deletions
diff --git a/gui/src/renderer/redux/userinterface/actions.ts b/gui/src/renderer/redux/userinterface/actions.ts deleted file mode 100644 index 238835318e..0000000000 --- a/gui/src/renderer/redux/userinterface/actions.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { MacOsScrollbarVisibility } from '../../../shared/ipc-schema'; -import { IChangelog } from '../../../shared/ipc-types'; -import { LocationType } from '../../components/select-location/select-location-types'; - -export interface IUpdateLocaleAction { - type: 'UPDATE_LOCALE'; - locale: string; -} - -export interface IUpdateWindowArrowPositionAction { - type: 'UPDATE_WINDOW_ARROW_POSITION'; - arrowPosition: number; -} - -export interface IUpdateConnectionInfoOpenAction { - type: 'TOGGLE_CONNECTION_PANEL'; -} - -export interface ISetWindowFocusedAction { - type: 'SET_WINDOW_FOCUSED'; - focused: boolean; -} - -export interface ISetMacOsScrollbarVisibility { - type: 'SET_MACOS_SCROLLBAR_VISIBILITY'; - visibility: MacOsScrollbarVisibility; -} - -export interface ISetConnectedToDaemon { - type: 'SET_CONNECTED_TO_DAEMON'; - connectedToDaemon: boolean; -} - -export interface ISetDaemonAllowed { - type: 'SET_DAEMON_ALLOWED'; - daemonAllowed: boolean; -} - -export interface ISetChangelog { - type: 'SET_CHANGELOG'; - changelog: IChangelog; -} - -export interface ISetForceShowChanges { - type: 'SET_FORCE_SHOW_CHANGES'; - forceShowChanges: boolean; -} - -export interface ISetIsPerformingPostUpgrade { - type: 'SET_IS_PERFORMING_POST_UPGRADE'; - isPerformingPostUpgrade: boolean; -} - -export interface ISetSelectLocationView { - type: 'SET_SELECT_LOCATION_VIEW'; - selectLocationView: LocationType; -} - -export interface ISetIsMacOs13OrNewer { - type: 'SET_IS_MACOS13_OR_NEWER'; - isMacOs13OrNewer: boolean; -} - -export type UserInterfaceAction = - | IUpdateLocaleAction - | IUpdateWindowArrowPositionAction - | IUpdateConnectionInfoOpenAction - | ISetWindowFocusedAction - | ISetMacOsScrollbarVisibility - | ISetConnectedToDaemon - | ISetDaemonAllowed - | ISetChangelog - | ISetForceShowChanges - | ISetIsPerformingPostUpgrade - | ISetSelectLocationView - | ISetIsMacOs13OrNewer; - -function updateLocale(locale: string): IUpdateLocaleAction { - return { - type: 'UPDATE_LOCALE', - locale, - }; -} - -function updateWindowArrowPosition(arrowPosition: number): IUpdateWindowArrowPositionAction { - return { - type: 'UPDATE_WINDOW_ARROW_POSITION', - arrowPosition, - }; -} - -function toggleConnectionPanel(): IUpdateConnectionInfoOpenAction { - return { - type: 'TOGGLE_CONNECTION_PANEL', - }; -} - -function setWindowFocused(focused: boolean): ISetWindowFocusedAction { - return { - type: 'SET_WINDOW_FOCUSED', - focused, - }; -} - -function setMacOsScrollbarVisibility( - visibility: MacOsScrollbarVisibility, -): ISetMacOsScrollbarVisibility { - return { - type: 'SET_MACOS_SCROLLBAR_VISIBILITY', - visibility, - }; -} - -function setConnectedToDaemon(connectedToDaemon: boolean): ISetConnectedToDaemon { - return { - type: 'SET_CONNECTED_TO_DAEMON', - connectedToDaemon, - }; -} - -function setDaemonAllowed(daemonAllowed: boolean): ISetDaemonAllowed { - return { - type: 'SET_DAEMON_ALLOWED', - daemonAllowed, - }; -} - -function setChangelog(changelog: IChangelog): ISetChangelog { - return { - type: 'SET_CHANGELOG', - changelog, - }; -} - -function setForceShowChanges(forceShowChanges: boolean): ISetForceShowChanges { - return { - type: 'SET_FORCE_SHOW_CHANGES', - forceShowChanges, - }; -} - -function setIsPerformingPostUpgrade(isPerformingPostUpgrade: boolean): ISetIsPerformingPostUpgrade { - return { - type: 'SET_IS_PERFORMING_POST_UPGRADE', - isPerformingPostUpgrade, - }; -} - -function setSelectLocationView(selectLocationView: LocationType): ISetSelectLocationView { - return { - type: 'SET_SELECT_LOCATION_VIEW', - selectLocationView, - }; -} - -function setIsMacOs13OrNewer(isMacOs13OrNewer: boolean): ISetIsMacOs13OrNewer { - return { - type: 'SET_IS_MACOS13_OR_NEWER', - isMacOs13OrNewer, - }; -} - -export default { - updateLocale, - updateWindowArrowPosition, - toggleConnectionPanel, - setWindowFocused, - setMacOsScrollbarVisibility, - setConnectedToDaemon, - setDaemonAllowed, - setChangelog, - setForceShowChanges, - setIsPerformingPostUpgrade, - setSelectLocationView, - setIsMacOs13OrNewer, -}; diff --git a/gui/src/renderer/redux/userinterface/reducers.ts b/gui/src/renderer/redux/userinterface/reducers.ts deleted file mode 100644 index 89427e9b06..0000000000 --- a/gui/src/renderer/redux/userinterface/reducers.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { MacOsScrollbarVisibility } from '../../../shared/ipc-schema'; -import { IChangelog } from '../../../shared/ipc-types'; -import { LocationType } from '../../components/select-location/select-location-types'; -import { ReduxAction } from '../store'; - -export interface IUserInterfaceReduxState { - locale: string; - arrowPosition?: number; - connectionPanelVisible: boolean; - windowFocused: boolean; - macOsScrollbarVisibility?: MacOsScrollbarVisibility; - connectedToDaemon: boolean; - daemonAllowed?: boolean; - changelog: IChangelog; - forceShowChanges: boolean; - isPerformingPostUpgrade: boolean; - selectLocationView: LocationType; - isMacOs13OrNewer: boolean; -} - -const initialState: IUserInterfaceReduxState = { - locale: 'en', - connectionPanelVisible: false, - windowFocused: false, - macOsScrollbarVisibility: undefined, - connectedToDaemon: false, - daemonAllowed: undefined, - changelog: [], - forceShowChanges: false, - isPerformingPostUpgrade: false, - selectLocationView: LocationType.exit, - isMacOs13OrNewer: true, -}; - -export default function ( - state: IUserInterfaceReduxState = initialState, - action: ReduxAction, -): IUserInterfaceReduxState { - switch (action.type) { - case 'UPDATE_LOCALE': - return { ...state, locale: action.locale }; - - case 'UPDATE_WINDOW_ARROW_POSITION': - return { ...state, arrowPosition: action.arrowPosition }; - - case 'TOGGLE_CONNECTION_PANEL': - return { ...state, connectionPanelVisible: !state.connectionPanelVisible }; - - case 'SET_WINDOW_FOCUSED': - return { ...state, windowFocused: action.focused }; - - case 'SET_MACOS_SCROLLBAR_VISIBILITY': - return { ...state, macOsScrollbarVisibility: action.visibility }; - - case 'SET_CONNECTED_TO_DAEMON': - return { ...state, connectedToDaemon: action.connectedToDaemon }; - - case 'SET_DAEMON_ALLOWED': - return { ...state, daemonAllowed: action.daemonAllowed }; - - case 'SET_CHANGELOG': - return { - ...state, - changelog: action.changelog, - }; - - case 'SET_FORCE_SHOW_CHANGES': - return { - ...state, - forceShowChanges: action.forceShowChanges, - }; - - case 'SET_IS_PERFORMING_POST_UPGRADE': - return { - ...state, - isPerformingPostUpgrade: action.isPerformingPostUpgrade, - }; - - case 'SET_SELECT_LOCATION_VIEW': - return { - ...state, - selectLocationView: action.selectLocationView, - }; - - case 'SET_IS_MACOS13_OR_NEWER': - return { - ...state, - isMacOs13OrNewer: action.isMacOs13OrNewer, - }; - - default: - return state; - } -} |
