Browse Source

removed UNSTABLE_getReact from settingeditor

- now UNSTABLE_getReact is only needed for two usages in launcher
telamonian 5 years ago
parent
commit
000e153802

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

@@ -277,14 +277,21 @@ namespace Private {
             key={id}
             title={itemTitle}
           >
-            <LabIcon.UNSTABLE_getReact
-              name={icon}
-              fallback={settingsIcon}
-              className={iconClass}
-              title={iconTitle}
-              tag="span"
-              kind="settingsEditor"
-            />
+            {!(icon || iconClass) ? (
+              <settingsIcon.react
+                title={iconTitle}
+                tag="span"
+                kind="settingsEditor"
+              />
+            ) : (
+              <LabIcon.resolveReact
+                icon={icon}
+                iconClass={iconClass}
+                title={iconTitle}
+                tag="span"
+                kind="settingsEditor"
+              />
+            )}
             <span>{schema.title || id}</span>
           </li>
         );

+ 3 - 3
packages/ui-components/src/icon/labicon.tsx

@@ -51,11 +51,11 @@ export class LabIcon implements LabIcon.ILabIcon, LabIcon.IRenderer {
   }
 
   /**
-   * UNSTABLE - only exists for backwards compatibility in two special cases
+   * UNSTABLE - only exists for handling a single special case
    *
-   * TODO: Fix the remaining cases that rely on this and then remove this method:
+   * TODO: Fix the remaining case that relies on this and then
+   *   remove this method:
    *     - index.tsx in launcher
-   *     - pluginlist.tsx in settingseditor
    */
   static UNSTABLE_getReact({
     name,