Move notifications into a modal and remove app inspect

Summary: Also removing topLevelSelection as it is no longer used in flipper

Reviewed By: aigoncharov

Differential Revision: D48069386

fbshipit-source-id: 6e4cdd6aab67d2cd30ac1884118703520125bf84
This commit is contained in:
Anton Kastritskiy
2023-08-07 03:54:28 -07:00
committed by Facebook GitHub Bot
parent 08371d3a6b
commit 9cceca6d7e
4 changed files with 44 additions and 88 deletions

View File

@@ -11,8 +11,6 @@ import {v1 as uuidv1} from 'uuid';
import {getRenderHostInstance} from 'flipper-frontend-core';
import {Actions} from './';
export type ToplevelNavigationItem = 'appinspect' | 'notification' | undefined;
export type LauncherMsg = {
message: string;
severity: 'warning' | 'error';
@@ -39,8 +37,8 @@ export type ShareType = {
} & SubShareType;
export type State = {
topLevelSelection: ToplevelNavigationItem;
isTroubleshootingModalOpen: boolean;
isNotificationModalOpen: boolean;
leftSidebarVisible: boolean;
rightSidebarVisible: boolean;
rightSidebarAvailable: boolean;
@@ -54,6 +52,7 @@ export type State = {
type BooleanActionType =
| 'hasLeftSidebar'
| 'leftSidebarVisible'
| 'isNotificationModalOpen'
| 'rightSidebarVisible'
| 'rightSidebarAvailable';
@@ -62,10 +61,6 @@ export type Action =
type: BooleanActionType;
payload?: boolean;
}
| {
type: 'topLevelSelection';
payload: ToplevelNavigationItem;
}
| {
type: 'windowIsFocused';
payload: {isFocused: boolean; time: number};
@@ -93,6 +88,7 @@ export const initialState: () => State = () => ({
topLevelSelection: 'appinspect',
hasLeftSidebar: true,
isTroubleshootingModalOpen: false,
isNotificationModalOpen: false,
leftSidebarVisible: true,
rightSidebarVisible: true,
rightSidebarAvailable: false,
@@ -127,6 +123,7 @@ export default function reducer(
if (
action.type === 'leftSidebarVisible' ||
action.type === 'rightSidebarVisible' ||
action.type === 'isNotificationModalOpen' ||
action.type === 'rightSidebarAvailable'
) {
const newValue =
@@ -143,13 +140,6 @@ export default function reducer(
[action.type]: newValue,
};
}
} else if (action.type === 'topLevelSelection') {
const topLevelSelection = action.payload;
return {
...state,
topLevelSelection,
};
} else if (action.type === 'TOGGLE_CONNECTIVITY_MODAL') {
return {
...state,
@@ -197,13 +187,6 @@ export const toggleAction = (
payload,
});
export const setTopLevelSelection = (
payload: ToplevelNavigationItem,
): Action => ({
type: 'topLevelSelection',
payload,
});
export const toggleConnectivityModal = (): Action => ({
type: 'TOGGLE_CONNECTIVITY_MODAL',
});