From 45949e84565cfcc7524e0975f997d0ea11de2f95 Mon Sep 17 00:00:00 2001 From: AAGaming Date: Thu, 7 Jul 2022 00:03:20 -0400 Subject: support non-ui plugins --- frontend/src/components/PluginView.tsx | 22 ++++++++++++---------- frontend/src/plugin.ts | 6 +++--- 2 files changed, 15 insertions(+), 13 deletions(-) (limited to 'frontend') diff --git a/frontend/src/components/PluginView.tsx b/frontend/src/components/PluginView.tsx index 953abd25..cc6dbefc 100644 --- a/frontend/src/components/PluginView.tsx +++ b/frontend/src/components/PluginView.tsx @@ -12,16 +12,18 @@ const PluginView: VFC = () => { return ( - {plugins.map(({ name, icon }) => ( - - setActivePlugin(name)}> -
-
{icon}
-
{name}
-
-
-
- ))} + {plugins + .filter((p) => p.content) + .map(({ name, icon }) => ( + + setActivePlugin(name)}> +
+
{icon}
+
{name}
+
+
+
+ ))}
); }; diff --git a/frontend/src/plugin.ts b/frontend/src/plugin.ts index 2780d679..ca36e75d 100644 --- a/frontend/src/plugin.ts +++ b/frontend/src/plugin.ts @@ -1,6 +1,6 @@ export interface Plugin { - name: any; - content: any; - icon: any; + name: string; + icon: JSX.Element; + content?: JSX.Element; onDismount?(): void; } -- cgit v1.2.3