support non-ui plugins

This commit is contained in:
AAGaming
2022-07-07 00:03:20 -04:00
parent e3a965329d
commit 45949e8456
2 changed files with 15 additions and 13 deletions
+12 -10
View File
@@ -12,16 +12,18 @@ const PluginView: VFC = () => {
return ( return (
<PanelSection> <PanelSection>
{plugins.map(({ name, icon }) => ( {plugins
<PanelSectionRow key={name}> .filter((p) => p.content)
<ButtonItem layout="below" onClick={() => setActivePlugin(name)}> .map(({ name, icon }) => (
<div style={{ display: 'flex', justifyContent: 'space-between' }}> <PanelSectionRow key={name}>
<div>{icon}</div> <ButtonItem layout="below" onClick={() => setActivePlugin(name)}>
<div>{name}</div> <div style={{ display: 'flex', justifyContent: 'space-between' }}>
</div> <div>{icon}</div>
</ButtonItem> <div>{name}</div>
</PanelSectionRow> </div>
))} </ButtonItem>
</PanelSectionRow>
))}
</PanelSection> </PanelSection>
); );
}; };
+3 -3
View File
@@ -1,6 +1,6 @@
export interface Plugin { export interface Plugin {
name: any; name: string;
content: any; icon: JSX.Element;
icon: any; content?: JSX.Element;
onDismount?(): void; onDismount?(): void;
} }