Introduce favorite plugins

Summary: This diff lands improved sidebar navigation. The old functionality to order plugins based on last-recently-used, and cropping at 5 items has been removed. Instead, items can be starred and their position will be fixed. Together with the app switcher introduced this should lead to a cleaner, stabler, and more customizable UI.

Reviewed By: jknoxville

Differential Revision: D18299401

fbshipit-source-id: 29b7eb3a4130933c637f7c81834558bf738d5bf0
This commit is contained in:
Michel Weststrate
2019-11-05 09:13:31 -08:00
committed by Facebook Github Bot
parent 969a857fae
commit 3cee927674
9 changed files with 373 additions and 278 deletions

View File

@@ -24,7 +24,8 @@ const ICONS = {
'caution-octagon': [16],
'caution-triangle': [16],
'chevron-down-outline': [10],
'chevron-down': [8],
'chevron-down': [8, 12],
'chevron-up': [8, 12],
'chevron-right': [8],
'dots-3-circle-outline': [16],
'info-circle': [16],
@@ -52,6 +53,8 @@ const ICONS = {
rocket: [20],
settings: [12],
star: [16, 24],
'star-slash': [16],
'life-event-major': [16],
target: [12, 16],
tools: [20],
};
@@ -77,7 +80,12 @@ function buildLocalIconPath(name, size, density) {
// $FlowFixMe not using flow in this file
function buildIconURL(name, size, density) {
const icon = getIconPartsFromName(name);
const url = `https://external.xx.fbcdn.net/assets/?name=${icon.trimmedName}&variant=${icon.variant}&size=${size}&set=facebook_icons&density=${density}x`;
// eslint-disable-next-line prettier/prettier
const url = `https://external.xx.fbcdn.net/assets/?name=${
icon.trimmedName
}&variant=${
icon.variant
}&size=${size}&set=facebook_icons&density=${density}x`;
if (
typeof window !== 'undefined' &&
(!ICONS[name] || !ICONS[name].includes(size))