From f8e51e13ef074a38ee50b768df1dde22ecd071e9 Mon Sep 17 00:00:00 2001 From: Anton Kastritskiy Date: Tue, 18 Jul 2023 03:52:34 -0700 Subject: [PATCH] remove LeftNavButton Summary: This was added initially for login button only which was redundant. Fixed in this diff Reviewed By: elboman Differential Revision: D47517366 fbshipit-source-id: 58191c618fe2e85d6a06e444029a308223b4e235 --- .../src/sandy-chrome/Navbar.tsx | 88 ++----------------- 1 file changed, 5 insertions(+), 83 deletions(-) diff --git a/desktop/flipper-ui-core/src/sandy-chrome/Navbar.tsx b/desktop/flipper-ui-core/src/sandy-chrome/Navbar.tsx index e0df26fa3..fe6f53b80 100644 --- a/desktop/flipper-ui-core/src/sandy-chrome/Navbar.tsx +++ b/desktop/flipper-ui-core/src/sandy-chrome/Navbar.tsx @@ -11,7 +11,6 @@ import { Dialog, Layout, NUX, - styled, theme, useMemoize, useTrackedCallback, @@ -19,13 +18,7 @@ import { withTrackingScope, } from 'flipper-plugin'; import {getRenderHostInstance} from 'flipper-frontend-core'; -import React, { - cloneElement, - useCallback, - useEffect, - useMemo, - useState, -} from 'react'; +import React, {useCallback, useEffect, useMemo, useState} from 'react'; import {useDispatch, useStore} from '../utils/useStore'; import config from '../fb-stubs/config'; import {isConnected, currentUser, logoutUser} from '../fb-stubs/user'; @@ -479,83 +472,12 @@ function LoginConnectivityButton() { ) : ( - <> - } - title="Log In" - onClick={() => showLoginDialog()} - /> - - ); -} - -const LeftRailButtonElem = styled(Button)<{kind?: 'small'}>(({kind}) => ({ - width: kind === 'small' ? 32 : 36, - height: kind === 'small' ? 32 : 36, - border: 'none', - boxShadow: 'none', -})); -LeftRailButtonElem.displayName = 'LeftRailButtonElem'; - -export function LeftRailButton({ - icon, - small, - selected, - toggled, - count, - title, - onClick, - disabled, -}: { - icon?: React.ReactElement; - small?: boolean; - toggled?: boolean; - selected?: boolean; - disabled?: boolean; - count?: number | true; - title?: string; - onClick?: React.MouseEventHandler; -}) { - const iconElement = - icon && cloneElement(icon, {style: {fontSize: small ? 16 : 24}}); - - let res = ( - ); - - if (count !== undefined) { - res = - count === true ? ( - - {res} - - ) : ( - - {res} - - ); - } - - if (title) { - res = ( - - {res} - - ); - } - - return res; } const menu = css`