From ad4c2092a5ecc75101d317401b41a9fb8de508a4 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 5 Apr 2019 06:44:40 -0700 Subject: [PATCH] Replace launcher error bar with titlebar indicator Summary: When starting Flipper with `--launcher-msg`, it currently shows a red error bar at the bottom. That's not ideal for various reasons including it looking kinda bad and it only supporting a single error (the last one set). This instead adds an action that shows an indicator next to the version at the top as we had it before with the previous system. Reviewed By: danielbuechele Differential Revision: D14778859 fbshipit-source-id: 28591de6262e090a4e59a7f5a8cd86d7b3abf8fe --- src/chrome/TitleBar.js | 10 ++++- src/chrome/UpdateIndicator.js | 48 +++++++++++++++++++++++ src/chrome/__tests__/TitleBar.electron.js | 1 + src/reducers/application.js | 25 +++++++++++- src/utils/launcher.js | 8 ++-- 5 files changed, 85 insertions(+), 7 deletions(-) create mode 100644 src/chrome/UpdateIndicator.js diff --git a/src/chrome/TitleBar.js b/src/chrome/TitleBar.js index 12d55a63f..cd9cdd03c 100644 --- a/src/chrome/TitleBar.js +++ b/src/chrome/TitleBar.js @@ -5,7 +5,7 @@ * @format */ -import type {ActiveSheet} from '../reducers/application'; +import type {ActiveSheet, LauncherMsg} from '../reducers/application'; import { colors, @@ -28,6 +28,7 @@ import { import DevicesButton from './DevicesButton.js'; import ScreenCaptureButtons from './ScreenCaptureButtons.js'; import AutoUpdateVersion from './AutoUpdateVersion.js'; +import UpdateIndicator from './UpdateIndicator.js'; import config from '../fb-stubs/config.js'; import {isAutoUpdaterEnabled} from '../utils/argvUtils.js'; import isProduction from '../utils/isProduction.js'; @@ -66,6 +67,7 @@ type Props = {| toggleLeftSidebarVisible: (visible?: boolean) => void, toggleRightSidebarVisible: (visible?: boolean) => void, setActiveSheet: (sheet: ActiveSheet) => void, + launcherMsg: LauncherMsg, |}; const VersionText = styled(Text)({ @@ -100,7 +102,9 @@ class TitleBar extends Component { {isAutoUpdaterEnabled() ? ( - ) : null} + ) : ( + + )} {config.bugReportButtonVisible && (