Add Button to Expand or Collapse Left Panel

Summary:
- Add `show more` and `show less` button to expand and collapse
- The element to show depends on its usage rank from Flipper dashboard (manually copied)

Reviewed By: danielbuechele

Differential Revision: D16917952

fbshipit-source-id: fc37d5c640be33794694e302341fa08849b8f97f
This commit is contained in:
Chaiwat Ekkaewnumchai
2019-08-21 08:48:25 -07:00
committed by Facebook Github Bot
parent d1b17d3ecd
commit afd7634fd6
4 changed files with 86 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
/**
* Copyright 2018-present Facebook.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @format
*/
// copied from Flipper dashboard
const pluginRanking = [
'DeviceLogs',
'Inspector',
'Network',
'AnalyticsLogging',
'GraphQL',
'oculus-service-logs',
'UIPerf',
'CrashReporter',
'Msys',
'React',
'Databases',
'notifications',
'MobileConfig',
'FunnelLogger',
'Fresco',
'MScreen',
'Preferences',
'DeviceCPU',
'Hermesdebugger',
'vros-event-profiler',
'Mobileboost',
'Sections',
'Composer',
'Stories',
'DesignOverlay',
];
export function isTopUsedPlugin(pluginName: string, range: number): boolean {
const rank = pluginRanking.findIndex((name: string) => {
return name === pluginName;
});
return rank >= 0 && rank < range;
}