diff options
| author | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2026-09-06 19:06:52 -0400 |
|---|---|---|
| committer | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2026-09-06 19:06:52 -0400 |
| commit | 170d183fdafc1ec1a686c006fd6a2431c1f30c71 (patch) | |
| tree | 3732287c0d1a96bfb44508139f0e5687265730e9 /src/components/InstallationButton.tsx | |
| parent | c9be32287ad5b72fcd86b10fa726d09dbd97d7fd (diff) | |
| download | decky-lsfg-vk-170d183fdafc1ec1a686c006fd6a2431c1f30c71.tar.gz decky-lsfg-vk-170d183fdafc1ec1a686c006fd6a2431c1f30c71.zip | |
refactor: align secondary tabs with Decky UI
Diffstat (limited to 'src/components/InstallationButton.tsx')
| -rw-r--r-- | src/components/InstallationButton.tsx | 43 |
1 files changed, 8 insertions, 35 deletions
diff --git a/src/components/InstallationButton.tsx b/src/components/InstallationButton.tsx index 7f0ac96..1bf10ac 100644 --- a/src/components/InstallationButton.tsx +++ b/src/components/InstallationButton.tsx @@ -1,5 +1,4 @@ import { ButtonItem, PanelSectionRow } from "@decky/ui"; -import { FaDownload, FaTrash } from "react-icons/fa"; import t from '../i18n/i18n'; interface InstallationButtonProps { @@ -17,39 +16,13 @@ export function InstallationButton({ onInstall, onUninstall }: InstallationButtonProps) { - const renderButtonContent = () => { - if (isInstalling) { - return ( - <div style={{ display: "flex", alignItems: "center", gap: "8px" }}> - <div>{t('INSTALL_INSTALLING', 'Installing...')}</div> - </div> - ); - } - - if (isUninstalling) { - return ( - <div style={{ display: "flex", alignItems: "center", gap: "8px" }}> - <div>{t('INSTALL_UNINSTALLING', 'Uninstalling...')}</div> - </div> - ); - } - - if (isInstalled) { - return ( - <div style={{ display: "flex", alignItems: "center", gap: "8px" }}> - <FaTrash /> - <div>{t('INSTALL_UNINSTALL_BTN', 'Uninstall LSFG-VK')}</div> - </div> - ); - } - - return ( - <div style={{ display: "flex", alignItems: "center", gap: "8px" }}> - <FaDownload /> - <div>{t('INSTALL_INSTALL_BTN', 'Install LSFG-VK')}</div> - </div> - ); - }; + const label = isInstalling + ? t('INSTALL_INSTALLING', 'Installing...') + : isUninstalling + ? t('INSTALL_UNINSTALLING', 'Uninstalling...') + : isInstalled + ? t('INSTALL_UNINSTALL_BTN', 'Uninstall LSFG-VK') + : t('INSTALL_INSTALL_BTN', 'Install LSFG-VK'); return ( <PanelSectionRow> @@ -58,7 +31,7 @@ export function InstallationButton({ onClick={isInstalled ? onUninstall : onInstall} disabled={isInstalling || isUninstalling} > - {renderButtonContent()} + {label} </ButtonItem> </PanelSectionRow> ); |
