From 57d4c99e0fd07654e91116b4403cadd9fb93ffac Mon Sep 17 00:00:00 2001 From: Anton Kastritskiy Date: Thu, 20 Jul 2023 03:54:19 -0700 Subject: [PATCH] Move "Rage" and "Add plugins" buttons into menus Reviewed By: lblasa Differential Revision: D47591384 fbshipit-source-id: 4a79373c28e1103ddc351acbcab60650cc8a8eee --- .../src/sandy-chrome/Navbar.tsx | 76 ++++++++----------- 1 file changed, 31 insertions(+), 45 deletions(-) diff --git a/desktop/flipper-ui-core/src/sandy-chrome/Navbar.tsx b/desktop/flipper-ui-core/src/sandy-chrome/Navbar.tsx index fe6f53b80..d33c0c732 100644 --- a/desktop/flipper-ui-core/src/sandy-chrome/Navbar.tsx +++ b/desktop/flipper-ui-core/src/sandy-chrome/Navbar.tsx @@ -25,10 +25,8 @@ import {isConnected, currentUser, logoutUser} from '../fb-stubs/user'; import {showLoginDialog} from '../chrome/fb-stubs/SignInSheet'; import {Avatar, Badge, Button, Menu, Modal, Popover, Tooltip} from 'antd'; import { - AppstoreAddOutlined, BellOutlined, BugOutlined, - ExportOutlined, LayoutOutlined, LoginOutlined, MobileOutlined, @@ -111,20 +109,12 @@ export const Navbar = withTrackingScope(function Navbar({ )} - { - Dialog.showModal((onHide) => ); - }} - /> - {config.showLogin && } @@ -133,41 +123,6 @@ export const Navbar = withTrackingScope(function Navbar({ ); }); -function ExportEverythingEverywhereAllAtOnceButton() { - const store = useStore(); - const [status, setStatus] = useState< - ExportEverythingEverywhereAllAtOnceStatus | undefined - >(); - - const exportEverythingEverywhereAllAtOnceTracked = useTrackedCallback( - 'Debug data export', - () => - exportEverythingEverywhereAllAtOnce( - store, - (...args) => setStatus(args), - config.isFBBuild, - ), - [store, setStatus], - ); - - return ( - <> - - - { - exportEverythingEverywhereAllAtOnceTracked(); - }} - /> - - - ); -} function ExportEverythingEverywhereAllAtOnceStatusModal({ status, setStatus, @@ -506,6 +461,21 @@ function TroubleshootMenu({ }: { setToplevelSelection: (x: ToplevelNavItem) => void; }) { + const store = useStore(); + const [status, setStatus] = useState< + ExportEverythingEverywhereAllAtOnceStatus | undefined + >(); + + const exportEverythingEverywhereAllAtOnceTracked = useTrackedCallback( + 'Debug data export', + () => + exportEverythingEverywhereAllAtOnce( + store, + (...args) => setStatus(args), + config.isFBBuild, + ), + [store, setStatus], + ); const [isDoctorVisible, setIsDoctorVisible] = useState(false); const result = useStore( (state) => state.healthchecks.healthcheckReport.result, @@ -551,6 +521,11 @@ function TroubleshootMenu({ onClick={() => setIsDoctorVisible(true)}> Setup Doctor + + Rage + @@ -558,6 +533,10 @@ function TroubleshootMenu({ visible={isDoctorVisible} onClose={() => setIsDoctorVisible(false)} /> + ); } @@ -603,6 +582,13 @@ function ExtrasMenu() { key="extras" title={} className={submenu}> + { + Dialog.showModal((onHide) => ); + }}> + Add Plugins + {canOpenDialog() ? ( Import Flipper file