diff --git a/desktop/app/src/chrome/plugin-manager/PluginDebugger.tsx b/desktop/app/src/chrome/plugin-manager/PluginDebugger.tsx index afc6c055f..0b360f979 100644 --- a/desktop/app/src/chrome/plugin-manager/PluginDebugger.tsx +++ b/desktop/app/src/chrome/plugin-manager/PluginDebugger.tsx @@ -12,7 +12,7 @@ import Client from '../../Client'; import {TableBodyRow} from '../../ui/components/table/types'; import React, {Component, Fragment} from 'react'; import {connect} from 'react-redux'; -import {Text, ManagedTable, styled, colors, Link} from '../../ui'; +import {Text, ManagedTable, styled, colors} from '../../ui'; import StatusIndicator from '../../ui/components/StatusIndicator'; import {State as Store} from '../../reducers'; import {PluginDefinition} from '../../plugin'; @@ -30,7 +30,7 @@ const Ellipsis = styled(Text)({ const TableContainer = styled.div({ marginTop: 10, - height: 400, + height: 480, }); const Lamp = (props: {on: boolean}) => ( diff --git a/desktop/app/src/chrome/plugin-manager/PluginInstaller.tsx b/desktop/app/src/chrome/plugin-manager/PluginInstaller.tsx index ac7fa97e5..8f46368f8 100644 --- a/desktop/app/src/chrome/plugin-manager/PluginInstaller.tsx +++ b/desktop/app/src/chrome/plugin-manager/PluginInstaller.tsx @@ -7,23 +7,8 @@ * @format */ -import { - FlexColumn, - styled, - SearchInput, - SearchBox, - Button, - colors, - Spacer, - FlexRow, - Glyph, - Link, - Text, - LoadingIndicator, - Tooltip, - TableRows, - ManagedTable, -} from '../../ui'; +import {Layout, theme} from 'flipper-plugin'; +import {LoadingIndicator, TableRows, ManagedTable, Glyph} from '../../ui'; import React, {useCallback, useState, useEffect} from 'react'; import {reportPlatformFailures, reportUsage} from '../../utils/metrics'; import reloadFlipper from '../../utils/reloadFlipper'; @@ -42,15 +27,12 @@ import {connect} from 'react-redux'; import {Dispatch, Action} from 'redux'; import PluginPackageInstaller from './PluginPackageInstaller'; import {Toolbar} from 'flipper-plugin'; +import {Alert, Button, Input, Tooltip, Typography} from 'antd'; + +const {Text, Link} = Typography; const TAG = 'PluginInstaller'; -const EllipsisText = styled(Text)({ - overflow: 'hidden', - textOverflow: 'ellipsis', - whiteSpace: 'nowrap', -}); - const columnSizes = { name: '25%', version: '10%', @@ -73,23 +55,6 @@ const columns = { }, }; -const Container = styled(FlexColumn)({ - height: 300, - backgroundColor: colors.white, - borderRadius: 4, - overflow: 'hidden', - border: `1px solid ${colors.macOSTitleBarButtonBorder}`, -}); - -const RestartBar = styled(FlexColumn)({ - backgroundColor: colors.red, - color: colors.white, - fontWeight: 500, - padding: 10, - cursor: 'pointer', - textAlign: 'center', -}); - type PropsFromState = { installedPlugins: Map; }; @@ -127,51 +92,38 @@ const PluginInstaller = function ({ }, []); return ( - <> - - {restartRequired && ( - - To apply the changes, Flipper needs to reload. Click here to reload! - - )} - - - setQuery(e.target.value)} - value={query} - placeholder="Search Flipper plugins..." - /> - - - + {restartRequired && ( + - + )} + + setQuery(e.target.value)} + value={query} + placeholder="Search Flipper plugins..." + /> + + - + ); }; -const TableButton = styled(Button)({ - marginTop: 2, -}); - -const Spinner = styled(LoadingIndicator)({ - marginTop: 6, -}); - -const AlignedGlyph = styled(Glyph)({ - marginTop: 6, -}); - function InstallButton(props: { name: string; version: string; @@ -240,13 +192,13 @@ function InstallButton(props: { ); if (action.kind === 'Waiting') { - return ; + return ; } if ((action.kind === 'Install' || action.kind === 'Remove') && action.error) { } const button = ( - { switch (action.kind) { @@ -262,22 +214,22 @@ function InstallButton(props: { } }}> {action.kind} - + ); if (action.error) { const glyph = ( - + ); return ( - + {button} - + ); } else { return button; @@ -302,25 +254,24 @@ function useNPMSearch( key: h.name, columns: { name: { - value: ( - - {h.name.replace(/^flipper-plugin-/, '')} - - ), + value: {h.name.replace(/^flipper-plugin-/, '')}, }, version: { - value: {h.version}, + value: {h.version}, align: 'flex-end' as 'flex-end', }, description: { value: ( - - {h.description} - + + {h.description} - + - + ), }, install: { diff --git a/desktop/app/src/chrome/plugin-manager/PluginManager.tsx b/desktop/app/src/chrome/plugin-manager/PluginManager.tsx index a1d99fd1b..ff3578260 100644 --- a/desktop/app/src/chrome/plugin-manager/PluginManager.tsx +++ b/desktop/app/src/chrome/plugin-manager/PluginManager.tsx @@ -7,41 +7,23 @@ * @format */ -import React, {useState} from 'react'; -import {FlexColumn, Button, styled, Tab, Tabs, TabsContainer} from '../../ui'; +import React from 'react'; +import {Tab, Tabs} from 'flipper-plugin'; import PluginDebugger from './PluginDebugger'; import PluginInstaller from './PluginInstaller'; - -const Container = styled(FlexColumn)({ - padding: 15, - width: 760, -}); - -const Row = styled(FlexColumn)({ - alignItems: 'flex-end', -}); - -type TabsState = 'Plugin Status' | 'Install Plugins'; +import {Modal} from 'antd'; export default function (props: {onHide: () => any}) { - const [tab, setTab] = useState('Plugin Status'); return ( - - - void}> - - - - {tab === 'Plugin Status' && } - {tab === 'Install Plugins' && } - - - - - + + + + + + + + + + ); } diff --git a/desktop/app/src/chrome/plugin-manager/__tests__/__snapshots__/PluginInstaller.node.tsx.snap b/desktop/app/src/chrome/plugin-manager/__tests__/__snapshots__/PluginInstaller.node.tsx.snap index 631804134..b420e1a38 100644 --- a/desktop/app/src/chrome/plugin-manager/__tests__/__snapshots__/PluginInstaller.node.tsx.snap +++ b/desktop/app/src/chrome/plugin-manager/__tests__/__snapshots__/PluginInstaller.node.tsx.snap @@ -3,21 +3,54 @@ exports[`load PluginInstaller list 1`] = `
- + + + + + + +
-