diff options
| author | botato <63275405+botatooo@users.noreply.github.com> | 2022-07-01 23:43:17 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-01 16:43:17 -0700 |
| commit | 4daf028e7acb49932e274ad5c32cd98045c7474a (patch) | |
| tree | fa75d035d90d30d3cb7e2ecd17cb3f8e8f67b168 /frontend/src/components/settings/pages/PluginList.tsx | |
| parent | 934a50f683f579695292f88437d91d4fce2f4edc (diff) | |
| download | decky-loader-4daf028e7acb49932e274ad5c32cd98045c7474a.tar.gz decky-loader-4daf028e7acb49932e274ad5c32cd98045c7474a.zip | |
Uninstall functionality (#97)
* feat: POC uninstallation feature
* Fixes, placeholder
* bugfix: wrong function call
* add oncancel and change function called
* clean up plugin uninstall code
* bugfix, uninstall in store
* Limit scope of feature branch
* feat: PluginLoader.unloadPlugin
* problematic logs
Diffstat (limited to 'frontend/src/components/settings/pages/PluginList.tsx')
| -rw-r--r-- | frontend/src/components/settings/pages/PluginList.tsx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/frontend/src/components/settings/pages/PluginList.tsx b/frontend/src/components/settings/pages/PluginList.tsx new file mode 100644 index 00000000..4fd2c063 --- /dev/null +++ b/frontend/src/components/settings/pages/PluginList.tsx @@ -0,0 +1,32 @@ +import { DialogButton, staticClasses } from 'decky-frontend-lib'; +import { FaTrash } from 'react-icons/fa'; + +export default function PluginList() { + const plugins = window.DeckyPluginLoader?.getPlugins(); + + if (plugins.length === 0) { + return ( + <div> + <p>No plugins installed</p> + </div> + ); + } + + return ( + <ul style={{ listStyleType: 'none' }}> + {window.DeckyPluginLoader?.getPlugins().map(({ name }) => ( + <li style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}> + <span>{name}</span> + <div className={staticClasses.Title} style={{ marginLeft: 'auto', boxShadow: 'none' }}> + <DialogButton + style={{ height: '40px', width: '40px', padding: '10px 12px' }} + onClick={() => window.DeckyPluginLoader.uninstall_plugin(name)} + > + <FaTrash /> + </DialogButton> + </div> + </li> + ))} + </ul> + ); +} |
