Move ToolbarIcon to main ui components folder

Summary: there are two plugins which uses copy-pasted ToolbarIcon and at least one more where it will be helpful. Let's move it to components folder

Reviewed By: nikoant

Differential Revision: D21089290

fbshipit-source-id: a14dcd56633dd24016711e34308b94023fcb40ed
This commit is contained in:
Timur Valiev
2020-04-21 08:33:05 -07:00
committed by Facebook GitHub Bot
parent 75fb681eb8
commit 764ba546f7
4 changed files with 6 additions and 2 deletions

View File

@@ -1,41 +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 {Glyph, styled, colors} from 'flipper';
import React from 'react';
type Props = {
title: string;
icon: string;
active: boolean;
onClick: () => void;
};
const ToolbarIcon = styled.div({
marginRight: 9,
marginTop: -3,
marginLeft: 4,
position: 'relative', // for settings popover positioning
});
export default function (props: Props) {
return (
<ToolbarIcon onClick={props.onClick} title={props.title}>
<Glyph
name={props.icon}
size={16}
color={
props.active
? colors.macOSTitleBarIconSelected
: colors.macOSTitleBarIconActive
}
/>
</ToolbarIcon>
);
}

View File

@@ -28,9 +28,9 @@ import {
constants,
ReduxState,
ArchivedDevice,
ToolbarIcon,
} from 'flipper';
import Inspector from './Inspector';
import ToolbarIcon from './ToolbarIcon';
import InspectorSidebar from './InspectorSidebar';
import Search from './Search';
import ProxyArchiveClient from './ProxyArchiveClient';