diff options
| author | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-01-23 18:40:59 -0500 |
|---|---|---|
| committer | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-01-23 18:40:59 -0500 |
| commit | 28de5d077c1ca98325cca76b756f2afd486403a6 (patch) | |
| tree | c477614bee6377eb4a34d92f9b6c7a00743e3b88 | |
| parent | 31fc7b2a0a5fe70f98efce380022f80680770f92 (diff) | |
| download | Decky-Framegen-28de5d077c1ca98325cca76b756f2afd486403a6.tar.gz Decky-Framegen-28de5d077c1ca98325cca76b756f2afd486403a6.zip | |
swap install and uninstall buttons depending on state
| -rwxr-xr-x | src/index.tsx | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/src/index.tsx b/src/index.tsx index 4162cf7..18fb0a5 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -87,16 +87,27 @@ function FGModInstallerSection() { return ( <PanelSection title="FG Mod Installer"> - <PanelSectionRow> - <ButtonItem layout="below" onClick={handleInstallClick} disabled={installing}> - {installing ? "Installing..." : "Install FG Mod"} - </ButtonItem> - </PanelSectionRow> - <PanelSectionRow> - <ButtonItem layout="below" onClick={handleUninstallClick} disabled={uninstalling}> - {uninstalling ? "Uninstalling..." : "Uninstall FG Mod"} - </ButtonItem> - </PanelSectionRow> + {pathExists !== null && ( + <PanelSectionRow> + <div style={{ color: pathExists ? "green" : "red" }}> + {pathExists ? "Mod Is Installed" : "Mod Not Installed"} + </div> + </PanelSectionRow> + )} + {pathExists === false && ( + <PanelSectionRow> + <ButtonItem layout="below" onClick={handleInstallClick} disabled={installing}> + {installing ? "Installing..." : "Install FG Mod"} + </ButtonItem> + </PanelSectionRow> + )} + {pathExists === true && ( + <PanelSectionRow> + <ButtonItem layout="below" onClick={handleUninstallClick} disabled={uninstalling}> + {uninstalling ? "Uninstalling..." : "Uninstall FG Mod"} + </ButtonItem> + </PanelSectionRow> + )} {installResult && ( <PanelSectionRow> <div> @@ -137,13 +148,6 @@ function FGModInstallerSection() { </div> </PanelSectionRow> )} - {pathExists !== null && ( - <PanelSectionRow> - <div style={{ color: pathExists ? "green" : "red" }}> - {pathExists ? "Mod Is Installed" : "Mod Not Installed"} - </div> - </PanelSectionRow> - )} <PanelSectionRow> <div> Once the patch is installed, launch your game, press "Set Launch Options" below, then restart the game! |
