|
|
|
@ -4,8 +4,8 @@ import { SessionSettingCategory } from '../../components/settings/SessionSetting
|
|
|
|
|
export const FOCUS_SECTION = 'FOCUS_SECTION';
|
|
|
|
|
export const FOCUS_SETTINGS_SECTION = 'FOCUS_SETTINGS_SECTION';
|
|
|
|
|
export const IS_APP_FOCUSED = 'IS_APP_FOCUSED';
|
|
|
|
|
export const OVERLAY_MODE = 'OVERLAY_MODE';
|
|
|
|
|
export const RESET_OVERLAY_MODE = 'RESET_OVERLAY_MODE';
|
|
|
|
|
export const LEFT_OVERLAY_MODE = 'LEFT_OVERLAY_MODE';
|
|
|
|
|
export const RESET_LEFT_OVERLAY_MODE = 'RESET_OVERLAY_MODE';
|
|
|
|
|
export const RIGHT_OVERLAY_MODE = 'RIGHT_OVERLAY_MODE';
|
|
|
|
|
export const RESET_RIGHT_OVERLAY_MODE = 'RESET_RIGHT_OVERLAY_MODE';
|
|
|
|
|
|
|
|
|
@ -32,12 +32,12 @@ type IsAppFocusedActionType = {
|
|
|
|
|
payload: boolean;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
type OverlayModeActionType = {
|
|
|
|
|
type: 'OVERLAY_MODE';
|
|
|
|
|
payload: OverlayMode;
|
|
|
|
|
type LeftOverlayModeActionType = {
|
|
|
|
|
type: 'LEFT_OVERLAY_MODE';
|
|
|
|
|
payload: LeftOverlayMode;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
type ResetOverlayModeActionType = {
|
|
|
|
|
type ResetLeftOverlayModeActionType = {
|
|
|
|
|
type: 'RESET_OVERLAY_MODE';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -66,24 +66,23 @@ export function setIsAppFocused(focused: boolean): IsAppFocusedActionType {
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO Should be renamed to LeftOverlayMode
|
|
|
|
|
export type OverlayMode =
|
|
|
|
|
export type LeftOverlayMode =
|
|
|
|
|
| 'choose-action'
|
|
|
|
|
| 'message'
|
|
|
|
|
| 'open-group'
|
|
|
|
|
| 'closed-group'
|
|
|
|
|
| 'message-requests';
|
|
|
|
|
|
|
|
|
|
export function setOverlayMode(overlayMode: OverlayMode): OverlayModeActionType {
|
|
|
|
|
export function setLeftOverlayMode(overlayMode: LeftOverlayMode): LeftOverlayModeActionType {
|
|
|
|
|
return {
|
|
|
|
|
type: OVERLAY_MODE,
|
|
|
|
|
type: LEFT_OVERLAY_MODE,
|
|
|
|
|
payload: overlayMode,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function resetOverlayMode(): ResetOverlayModeActionType {
|
|
|
|
|
export function resetLeftOverlayMode(): ResetLeftOverlayModeActionType {
|
|
|
|
|
return {
|
|
|
|
|
type: RESET_OVERLAY_MODE,
|
|
|
|
|
type: RESET_LEFT_OVERLAY_MODE,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -124,8 +123,8 @@ export function showSettingsSection(
|
|
|
|
|
export const actions = {
|
|
|
|
|
showLeftPaneSection,
|
|
|
|
|
showSettingsSection,
|
|
|
|
|
setOverlayMode,
|
|
|
|
|
resetOverlayMode,
|
|
|
|
|
setLeftOverlayMode,
|
|
|
|
|
resetLeftOverlayMode,
|
|
|
|
|
setRightOverlayMode,
|
|
|
|
|
resetRightOverlayMode,
|
|
|
|
|
};
|
|
|
|
@ -134,7 +133,7 @@ export const initialSectionState: SectionStateType = {
|
|
|
|
|
focusedSection: SectionType.Message,
|
|
|
|
|
focusedSettingsSection: undefined,
|
|
|
|
|
isAppFocused: false,
|
|
|
|
|
overlayMode: undefined,
|
|
|
|
|
leftOverlayMode: undefined,
|
|
|
|
|
rightOverlayMode: { type: 'default', params: null },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -142,7 +141,7 @@ export type SectionStateType = {
|
|
|
|
|
focusedSection: SectionType;
|
|
|
|
|
focusedSettingsSection?: SessionSettingCategory;
|
|
|
|
|
isAppFocused: boolean;
|
|
|
|
|
overlayMode: OverlayMode | undefined;
|
|
|
|
|
leftOverlayMode: LeftOverlayMode | undefined;
|
|
|
|
|
rightOverlayMode: RightOverlayMode | undefined;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -187,15 +186,15 @@ export const reducer = (
|
|
|
|
|
...state,
|
|
|
|
|
isAppFocused: payload,
|
|
|
|
|
};
|
|
|
|
|
case OVERLAY_MODE:
|
|
|
|
|
case LEFT_OVERLAY_MODE:
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
overlayMode: payload,
|
|
|
|
|
leftOverlayMode: payload,
|
|
|
|
|
};
|
|
|
|
|
case RESET_OVERLAY_MODE:
|
|
|
|
|
case RESET_LEFT_OVERLAY_MODE:
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
overlayMode: undefined,
|
|
|
|
|
leftOverlayMode: undefined,
|
|
|
|
|
};
|
|
|
|
|
case RIGHT_OVERLAY_MODE:
|
|
|
|
|
return {
|
|
|
|
|