diff options
| author | AAGaming <aa@mail.catvibers.me> | 2022-08-24 23:51:20 -0400 |
|---|---|---|
| committer | AAGaming <aa@mail.catvibers.me> | 2022-08-24 23:51:20 -0400 |
| commit | 79db0c779d6942c6bdc6823a5faef57b5307f7b3 (patch) | |
| tree | 3ba46c46750d7cdfc04f6c14191e0dd1177c170f /frontend/src/components/settings/pages/general/BranchSelect.tsx | |
| parent | fe2b6b02831c918c25d88604df94d8d2f360b75a (diff) | |
| download | decky-loader-79db0c779d6942c6bdc6823a5faef57b5307f7b3.tar.gz decky-loader-79db0c779d6942c6bdc6823a5faef57b5307f7b3.zip | |
Settings API for loader, preview branch select
Diffstat (limited to 'frontend/src/components/settings/pages/general/BranchSelect.tsx')
| -rw-r--r-- | frontend/src/components/settings/pages/general/BranchSelect.tsx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/frontend/src/components/settings/pages/general/BranchSelect.tsx b/frontend/src/components/settings/pages/general/BranchSelect.tsx new file mode 100644 index 00000000..91e814e5 --- /dev/null +++ b/frontend/src/components/settings/pages/general/BranchSelect.tsx @@ -0,0 +1,33 @@ +import { Dropdown, Field } from 'decky-frontend-lib'; +import { FunctionComponent } from 'react'; + +import { useSetting } from '../../../../utils/hooks/useSetting'; + +enum UpdateBranch { + Stable, + Prerelease, + Nightly, +} + +const BranchSelect: FunctionComponent<{}> = () => { + const [selectedBranch, setSelectedBranch] = useSetting<UpdateBranch>('branch', UpdateBranch.Prerelease); + + return ( + <Field label="Update Channel"> + <Dropdown + rgOptions={Object.values(UpdateBranch) + .filter((branch) => typeof branch == 'string') + .map((branch) => ({ + label: branch, + data: UpdateBranch[branch], + }))} + selectedOption={selectedBranch} + onChange={(newVal) => { + setSelectedBranch(newVal.data); + }} + /> + </Field> + ); +}; + +export default BranchSelect; |
