diff --git a/frontend/src/components/store/PluginCard.tsx b/frontend/src/components/store/PluginCard.tsx index 68257b5e..9fb3c2a1 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'; @@ -128,76 +128,82 @@ const PluginCard: FC = ({ storePlugin, installedPlugin }) => { )} -
- - -
+ + requestPluginInstall(storePlugin.name, storePlugin.versions[selectedOption], installType)} + > + {installType === InstallType.UPDATE ? ( + <> + {t('PluginCard.plugin_update')} + + ) : installType === InstallType.REINSTALL ? ( + <> + {t('PluginCard.plugin_reinstall')} + + ) : installType === InstallType.DOWNGRADE ? ( + <> + {t('PluginCard.plugin_downgrade')} + + ) : installType === InstallType.OVERWRITE ? ( + <> + {t('PluginCard.plugin_overwrite')} + + ) : ( + // installType === InstallType.INSTALL (also fallback) + <> + {t('PluginCard.plugin_install')} + + )} + + {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 }), + ); + }} > - - requestPluginInstall(storePlugin.name, storePlugin.versions[selectedOption], installType) - } - > - - {installType === InstallType.UPDATE ? ( - <> - {t('PluginCard.plugin_update')} - - ) : installType === InstallType.REINSTALL ? ( - <> - {t('PluginCard.plugin_reinstall')} - - ) : installType === InstallType.DOWNGRADE ? ( - <> - {t('PluginCard.plugin_downgrade')} - - ) : installType === InstallType.OVERWRITE ? ( - <> - {t('PluginCard.plugin_overwrite')} - - ) : ( - // installType === InstallType.INSTALL (also fallback) - <> - {t('PluginCard.plugin_install')} - - )} - - -
-
- ({ - data: index, - label: ( -
- {version.name} - {installedPlugin && installedVersionIndex === index ? : null} -
- ), - })) as SingleDropdownOption[] - } - menuLabel={t('PluginCard.plugin_version_label') as string} - selectedOption={selectedOption} - onChange={({ data }) => setSelectedOption(data)} - /> -
-
-
-
+ + + ) : null} +
+ ({ + data: index, + label: ( +
+ {version.name} + {installedPlugin && installedVersionIndex === index ? : null} +
+ ), + }), + )} + 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 3209ba08..4c5d7da8 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