diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-06-27 13:34:55 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2019-06-27 20:01:18 +0200 |
| commit | 55ee652e4ef13faea40d4f202dfa66d77a01c813 (patch) | |
| tree | 32419bf246017da10c03d149a210c96a6d18c09b /gui/src/renderer/redux/userinterface | |
| parent | 7068c166b53b0a24dfcffa2c31c30bd120816938 (diff) | |
| download | mullvadvpn-55ee652e4ef13faea40d4f202dfa66d77a01c813.tar.xz mullvadvpn-55ee652e4ef13faea40d4f202dfa66d77a01c813.zip | |
Refactor connection panel into container
Diffstat (limited to 'gui/src/renderer/redux/userinterface')
| -rw-r--r-- | gui/src/renderer/redux/userinterface/actions.ts | 10 | ||||
| -rw-r--r-- | gui/src/renderer/redux/userinterface/reducers.ts | 8 |
2 files changed, 8 insertions, 10 deletions
diff --git a/gui/src/renderer/redux/userinterface/actions.ts b/gui/src/renderer/redux/userinterface/actions.ts index 724f53883d..0af66cd365 100644 --- a/gui/src/renderer/redux/userinterface/actions.ts +++ b/gui/src/renderer/redux/userinterface/actions.ts @@ -4,8 +4,7 @@ export interface IUpdateWindowArrowPositionAction { } export interface IUpdateConnectionInfoOpenAction { - type: 'UPDATE_CONNECTION_INFO_OPEN'; - isOpen: boolean; + type: 'TOGGLE_CONNECTION_PANEL'; } export type UserInterfaceAction = @@ -19,11 +18,10 @@ function updateWindowArrowPosition(arrowPosition: number): IUpdateWindowArrowPos }; } -function updateConnectionInfoOpen(isOpen: boolean): IUpdateConnectionInfoOpenAction { +function toggleConnectionPanel(): IUpdateConnectionInfoOpenAction { return { - type: 'UPDATE_CONNECTION_INFO_OPEN', - isOpen, + type: 'TOGGLE_CONNECTION_PANEL', }; } -export default { updateWindowArrowPosition, updateConnectionInfoOpen }; +export default { updateWindowArrowPosition, toggleConnectionPanel }; diff --git a/gui/src/renderer/redux/userinterface/reducers.ts b/gui/src/renderer/redux/userinterface/reducers.ts index 75005fd423..c6e7aafde8 100644 --- a/gui/src/renderer/redux/userinterface/reducers.ts +++ b/gui/src/renderer/redux/userinterface/reducers.ts @@ -2,11 +2,11 @@ import { ReduxAction } from '../store'; export interface IUserInterfaceReduxState { arrowPosition?: number; - connectionInfoOpen: boolean; + connectionPanelVisible: boolean; } const initialState: IUserInterfaceReduxState = { - connectionInfoOpen: false, + connectionPanelVisible: false, }; export default function( @@ -17,8 +17,8 @@ export default function( case 'UPDATE_WINDOW_ARROW_POSITION': return { ...state, arrowPosition: action.arrowPosition }; - case 'UPDATE_CONNECTION_INFO_OPEN': - return { ...state, connectionInfoOpen: action.isOpen }; + case 'TOGGLE_CONNECTION_PANEL': + return { ...state, connectionPanelVisible: !state.connectionPanelVisible }; default: return state; |
