diff --git a/desktop/app/src/App.tsx b/desktop/app/src/App.tsx index c68895ad5..ec8f0d4ae 100644 --- a/desktop/app/src/App.tsx +++ b/desktop/app/src/App.tsx @@ -12,7 +12,6 @@ import {FlexRow, styled, Layout} from 'flipper'; import {connect} from 'react-redux'; import TitleBar from './chrome/TitleBar'; import MainSidebar2 from './chrome/mainsidebar/MainSidebar2'; -import ErrorBar from './chrome/ErrorBar'; import DoctorBar from './chrome/DoctorBar'; import ShareSheetExportUrl from './chrome/ShareSheetExportUrl'; import SignInSheet from './chrome/SignInSheet'; @@ -40,7 +39,7 @@ import { } from './reducers/application'; import {Logger} from './fb-interfaces/Logger'; import {State as Store} from './reducers/index'; -import {StaticView, FlipperError} from './reducers/connections'; +import {StaticView} from './reducers/connections'; import PluginManager from './chrome/plugin-manager/PluginManager'; import StatusBar from './chrome/StatusBar'; import SettingsSheet from './chrome/SettingsSheet'; @@ -59,7 +58,6 @@ type OwnProps = { type StateFromProps = { leftSidebarVisible: boolean; - errors: FlipperError[]; activeSheet: ActiveSheet; share: ShareType | null; staticView: StaticView; @@ -174,7 +172,6 @@ export class App extends React.Component { <> - <> {this.getSheet} @@ -214,12 +211,11 @@ export class App extends React.Component { export default connect( ({ application: {leftSidebarVisible, activeSheet, share}, - connections: {errors, staticView}, + connections: {staticView}, }) => ({ leftSidebarVisible, activeSheet, share: share, - errors, staticView, }), { diff --git a/desktop/app/src/__tests__/__snapshots__/createMockFlipperWithPlugin.node.tsx.snap b/desktop/app/src/__tests__/__snapshots__/createMockFlipperWithPlugin.node.tsx.snap index 297ea342c..1b4387c78 100644 --- a/desktop/app/src/__tests__/__snapshots__/createMockFlipperWithPlugin.node.tsx.snap +++ b/desktop/app/src/__tests__/__snapshots__/createMockFlipperWithPlugin.node.tsx.snap @@ -25,7 +25,6 @@ Object { "title": "MockAndroidDevice", }, ], - "errors": Array [], "selectedApp": "TestApp#Android#MockAndroidDevice#serial", "selectedDevice": Object { "deviceType": "physical", diff --git a/desktop/app/src/chrome/ErrorBar.tsx b/desktop/app/src/chrome/ErrorBar.tsx deleted file mode 100644 index 2bf69f3a2..000000000 --- a/desktop/app/src/chrome/ErrorBar.tsx +++ /dev/null @@ -1,200 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @format - */ - -import {styled, colors, Glyph} from 'flipper'; -import React, {useState, memo} from 'react'; -import {connect} from 'react-redux'; -import {FlipperError, dismissError} from '../reducers/connections'; -import {State as Store} from '../reducers/index'; -import {ErrorBlock, ButtonGroup, Button} from 'flipper'; -import {FlexColumn, FlexRow} from 'flipper'; - -type StateFromProps = { - errors: FlipperError[]; -}; - -type DispatchFromProps = { - dismissError: typeof dismissError; -}; - -type Props = DispatchFromProps & StateFromProps; - -const ErrorBar = memo(function ErrorBar(props: Props) { - const [collapsed, setCollapsed] = useState(true); - - if (!props.errors.length) { - return null; - } - - const errorCount = props.errors.reduce( - (sum, error) => sum + (error.occurrences || 1), - 0, - ); - - const urgentErrors = props.errors.filter((e) => e.urgent); - - return ( - - - {(collapsed ? urgentErrors : props.errors).map((error, index) => ( - props.dismissError(index)} - key={index} - error={error} - /> - ))} - - setCollapsed((c) => !c)} - title="Show / hide errors"> - - {collapsed && errorCount} - - - ); -}); - -export default connect( - ({connections: {errors}}) => ({ - errors, - }), - { - dismissError, - }, -)(ErrorBar); - -function ErrorTile({ - onDismiss, - error, -}: { - onDismiss: () => void; - error: FlipperError; -}) { - const [collapsed, setCollapsed] = useState(true); - return ( - - - - - {(error.details || error.error) && ( -