Pārlūkot izejas kodu

migrated icons in `settingeditor` pkg to JLIcon

telamonian 5 gadi atpakaļ
vecāks
revīzija
8d8bb4fdb1
1 mainītis faili ar 8 papildinājumiem un 20 dzēšanām
  1. 8 20
      packages/settingeditor/src/pluginlist.tsx

+ 8 - 20
packages/settingeditor/src/pluginlist.tsx

@@ -5,11 +5,7 @@
 
 import { ISettingRegistry } from '@jupyterlab/settingregistry';
 
-import {
-  classes,
-  DefaultIconReact,
-  defaultIconRegistry
-} from '@jupyterlab/ui-components';
+import { JLIcon, settingsIcon } from '@jupyterlab/ui-components';
 
 import { Message } from '@lumino/messaging';
 
@@ -194,12 +190,14 @@ export namespace PluginList {
  */
 namespace Private {
   /**
-   * The JupyterLab plugin schema key for the setting editor icon of a plugin.
+   * The JupyterLab plugin schema key for the setting editor
+   * icon class of a plugin.
    */
   const ICON_CLASS_KEY = 'jupyter.lab.setting-icon-class';
 
   /**
-   * The JupyterLab plugin schema key for the setting editor label of a plugin.
+   * The JupyterLab plugin schema key for the setting editor
+   * icon label of a plugin.
    */
   const ICON_LABEL_KEY = 'jupyter.lab.setting-icon-label';
 
@@ -261,9 +259,9 @@ namespace Private {
     const items = plugins.map(plugin => {
       const { id, schema, version } = plugin;
       const itemTitle = `${schema.description}\n${id}\n${version}`;
-      const image = getHint(ICON_CLASS_KEY, registry, plugin);
-      const iconClass = classes(image, 'jp-PluginList-icon', 'jp-MaterialIcon');
+      const iconClass = getHint(ICON_CLASS_KEY, registry, plugin);
       const iconTitle = getHint(ICON_LABEL_KEY, registry, plugin);
+      const icon = JLIcon.get(iconClass, settingsIcon);
 
       return (
         <li
@@ -272,17 +270,7 @@ namespace Private {
           key={id}
           title={itemTitle}
         >
-          {defaultIconRegistry.contains(image) ? (
-            <DefaultIconReact
-              name={image}
-              title={iconTitle}
-              className={''}
-              tag={'span'}
-              kind={'settingsEditor'}
-            />
-          ) : (
-            <span className={iconClass} title={iconTitle} />
-          )}
+          <icon.react title={iconTitle} tag={'span'} kind={'settingsEditor'} />
           <span>{schema.title || id}</span>
         </li>
       );