diff --git a/frontend/src/components/store/PluginCard.tsx b/frontend/src/components/store/PluginCard.tsx index f64abd094..c01c2b97e 100644 --- a/frontend/src/components/store/PluginCard.tsx +++ b/frontend/src/components/store/PluginCard.tsx @@ -1,7 +1,7 @@ -import { ButtonItem, Dropdown, Focusable, PanelSectionRow, SingleDropdownOption, SuspensefulImage } from '@decky/ui'; -import { CSSProperties, FC, useState } from 'react'; +import { DialogButton, Dropdown, Focusable, PanelSectionRow, SingleDropdownOption, SuspensefulImage } from '@decky/ui'; +import { FC, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import { FaArrowDown, FaArrowUp, FaCheck, FaDownload, FaRecycle } from 'react-icons/fa'; +import { FaArrowDown, FaArrowUp, FaCheck, FaDownload, FaRecycle, FaTrash } from 'react-icons/fa'; import { InstallType, Plugin } from '../../plugin'; import { StorePlugin, requestPluginInstall } from '../../store'; @@ -30,6 +30,7 @@ const PluginCard: FC = ({ storePlugin, installedPlugin }) => { const { t } = useTranslation(); + // IMPORTANT! The `deckyStore*` classes below seem unused but they exist for theme developers return (
= ({ storePlugin, installedPlugin }) => {
-
- + requestPluginInstall(storePlugin.name, storePlugin.versions[selectedOption], installType) } @@ -185,12 +174,34 @@ const PluginCard: FC = ({ storePlugin, installedPlugin }) => { )} - +
+ {installedPlugin && installedVersionIndex === selectedOption ? ( + { + DeckyPluginLoader.uninstallPlugin( + installedPlugin.name, + t('PluginLoader.plugin_uninstall.title', { name: installedPlugin.name }), + t('PluginLoader.plugin_uninstall.button'), + t('PluginLoader.plugin_uninstall.desc', { name: installedPlugin.name }), + ); + }} + > + + + ) : null}
({ + rgOptions={storePlugin.versions.map( + (version, index): SingleDropdownOption => ({ data: index, label: (
@@ -198,8 +209,8 @@ const PluginCard: FC = ({ storePlugin, installedPlugin }) => { {installedPlugin && installedVersionIndex === index ? : null}
), - })) as SingleDropdownOption[] - } + }), + )} menuLabel={t('PluginCard.plugin_version_label') as string} selectedOption={selectedOption} onChange={({ data }) => setSelectedOption(data)} diff --git a/frontend/src/components/store/Store.tsx b/frontend/src/components/store/Store.tsx index 3209ba088..4c5d7da89 100644 --- a/frontend/src/components/store/Store.tsx +++ b/frontend/src/components/store/Store.tsx @@ -109,11 +109,6 @@ const BrowseTab: FC<{ setPluginCount: Dispatch> }> return ( <> - {/* This should be used once filtering is added