Expand/Collapse Sidebar V0

Summary:
- Show all or show 5 LRU plugins
- Update when close/reopen app, collapse sidebar, or expand sidebar

Reviewed By: danielbuechele

Differential Revision: D16917950

fbshipit-source-id: 1e7edc86945162ea14e1cdaa89aa47d3defa4c7d
This commit is contained in:
Chaiwat Ekkaewnumchai
2019-08-21 08:48:25 -07:00
committed by Facebook Github Bot
parent 007a29805a
commit ea7578aa16
4 changed files with 25 additions and 54 deletions

View File

@@ -13,7 +13,6 @@ import {FlipperBasePlugin} from '../plugin';
import {PluginNotification} from '../reducers/notifications';
import {ActiveSheet} from '../reducers/application';
import {State as Store} from '../reducers';
import {isTopUsedPlugin} from '../fb-stubs/pluginUsage';
import {
Sidebar,
@@ -318,13 +317,12 @@ class MainSidebar extends PureComponent<Props> {
{Array.from(this.props.clientPlugins.values())
.filter(
(p: typeof FlipperDevicePlugin) =>
client.plugins.indexOf(p.id) > -1,
(client.showAllPlugins
? client.plugins
: client.lessPlugins
).indexOf(p.id) > -1,
)
.filter(
(p: typeof FlipperDevicePlugin) =>
client.showAllPlugins || isTopUsedPlugin(p.title, 5),
)
.sort(byPluginNameOrId)
.sort((a, b) => client.byClientLRU(a, b))
.map((plugin: typeof FlipperDevicePlugin) => (
<PluginSidebarListItem
key={plugin.id}