From ff3977da77edee6473d21039781a5d38a84d7279 Mon Sep 17 00:00:00 2001 From: John Knox Date: Thu, 15 Nov 2018 04:31:54 -0800 Subject: [PATCH] Show connecting spinner Summary: First step in visualising the connection setup process. Just a spinner while cert exchange is happening, so it doesn't look like nothing is happening. Reviewed By: passy Differential Revision: D13062514 fbshipit-source-id: a0692821025f42f4fe4af86faf059d4719008f25 --- src/chrome/MainSidebar.js | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/chrome/MainSidebar.js b/src/chrome/MainSidebar.js index a79b36ce1..a28abdfe4 100644 --- a/src/chrome/MainSidebar.js +++ b/src/chrome/MainSidebar.js @@ -8,6 +8,7 @@ import {FlipperBasePlugin} from '../plugin.js'; import type BaseDevice from '../devices/BaseDevice.js'; import type Client from '../Client.js'; +import type {UninitializedClient} from '../UninitializedClient.js'; import type {PluginNotification} from '../reducers/notifications'; import { @@ -22,6 +23,7 @@ import { GK, FlipperPlugin, FlipperDevicePlugin, + LoadingIndicator, } from 'flipper'; import React from 'react'; import {devicePlugins, clientPlugins} from '../plugins/index.js'; @@ -154,6 +156,13 @@ class PluginSidebarListItem extends Component<{ } } +const Spinner = styled(LoadingIndicator)({ + marginTop: '10px', + marginBottom: '10px', + marginLeft: 'auto', + marginRight: 'auto', +}); + type MainSidebarProps = {| selectedPlugin: ?string, selectedApp: ?string, @@ -164,6 +173,10 @@ type MainSidebarProps = {| selectedApp: ?string, }) => void, clients: Array, + uninitializedClients: Array<{ + client: UninitializedClient, + deviceId?: string, + }>, activeNotifications: Array, blacklistedPlugins: Array, |}; @@ -178,7 +191,7 @@ class MainSidebar extends Component { windowIsFocused, activeNotifications, } = this.props; - let {clients} = this.props; + let {clients, uninitializedClients} = this.props; clients = clients .filter( @@ -276,6 +289,12 @@ class MainSidebar extends Component { ))} ))} + {uninitializedClients.map(entry => ( + + {entry.client.appName} + + + ))} ); } @@ -288,7 +307,13 @@ class MainSidebar extends Component { export default connect( ({ application: {windowIsFocused}, - connections: {selectedDevice, selectedPlugin, selectedApp, clients}, + connections: { + selectedDevice, + selectedPlugin, + selectedApp, + clients, + uninitializedClients, + }, notifications: {activeNotifications, blacklistedPlugins}, }) => ({ blacklistedPlugins, @@ -298,6 +323,7 @@ export default connect( selectedPlugin, selectedApp, clients, + uninitializedClients, }), { selectPlugin,