0 && !selectedNonFavoritePlugin
}
title={collapsed => (
-
- {collapsed ? 'All plugins…' : 'Show less'}
+
-
+
)}>
);
});
+
+const ShowMoreButton = styled('div')({
+ border: `1px solid ${colors.macOSTitleBarIconBlur}`,
+ width: 16,
+ height: 16,
+ borderRadius: 16,
+ marginLeft: 'auto',
+ marginRight: 'auto',
+ lineHeight: '12px',
+});
diff --git a/src/chrome/mainsidebar/sidebarUtils.tsx b/src/chrome/mainsidebar/sidebarUtils.tsx
index ce903c048..a3ded1d08 100644
--- a/src/chrome/mainsidebar/sidebarUtils.tsx
+++ b/src/chrome/mainsidebar/sidebarUtils.tsx
@@ -22,7 +22,7 @@ import {
Spacer,
Heading,
} from 'flipper';
-import React, {Component} from 'react';
+import React, {useState, useCallback} from 'react';
import {StaticView} from '../../reducers/connections';
import {BackgroundColorProperty} from 'csstype';
@@ -135,7 +135,7 @@ export function centerInSidebar(component: any) {
});
}
-export class PluginSidebarListItem extends Component<{
+export const PluginSidebarListItem: React.FC<{
onClick: () => void;
isActive: boolean;
plugin: typeof FlipperBasePlugin;
@@ -144,27 +144,33 @@ export class PluginSidebarListItem extends Component<{
provided?: any;
onFavorite?: () => void;
starred?: boolean;
-}> {
- render() {
- const {isActive, plugin, onFavorite, starred} = this.props;
- const iconColor = getColorByApp(this.props.app);
+}> = function(props) {
+ const {isActive, plugin, onFavorite, starred} = props;
+ const iconColor = getColorByApp(props.app);
+ const [hovered, setHovered] = useState(false);
- return (
-
-
- {plugin.title || plugin.id}
- {starred !== undefined && (
-
- )}
-
- );
- }
-}
+ const onEnter = useCallback(() => setHovered(true), []);
+ const onLeave = useCallback(() => setHovered(false), []);
+
+ return (
+
+
+ {plugin.title || plugin.id}
+ {starred !== undefined && (hovered || isActive) && (
+
+ )}
+
+ );
+};
export function getColorByApp(app?: string | null): string {
let iconColor: string | undefined = (brandColors as any)[app!];