From 557295ba34d6554ea120355242825567ac88cbcc Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Tue, 22 Jul 2025 17:14:52 -0400 Subject: extract plus minus to own component --- src/components/ConfigurationSection.tsx | 63 ++--------------------------- src/components/FpsMultiplierControl.tsx | 72 +++++++++++++++++++++++++++++++++ src/components/index.ts | 1 + 3 files changed, 77 insertions(+), 59 deletions(-) create mode 100644 src/components/FpsMultiplierControl.tsx (limited to 'src') diff --git a/src/components/ConfigurationSection.tsx b/src/components/ConfigurationSection.tsx index 1a0107c..778ebc8 100644 --- a/src/components/ConfigurationSection.tsx +++ b/src/components/ConfigurationSection.tsx @@ -1,7 +1,8 @@ -import { PanelSectionRow, ToggleField, SliderField, DropdownItem, DialogButton, Focusable } from "@decky/ui"; +import { PanelSectionRow, ToggleField, SliderField, DropdownItem } from "@decky/ui"; import { ConfigurationData } from "../config/configSchema"; +import { FpsMultiplierControl } from "./FpsMultiplierControl"; import { - MULTIPLIER, FLOW_SCALE, PERFORMANCE_MODE, HDR_MODE, + FLOW_SCALE, PERFORMANCE_MODE, HDR_MODE, EXPERIMENTAL_PRESENT_MODE, DXVK_FRAME_RATE, DISABLE_STEAMDECK_MODE, MANGOHUD_WORKAROUND, DISABLE_VKBASALT } from "../config/generatedConfigSchema"; @@ -34,63 +35,7 @@ export function ConfigurationSection({ {/* FPS Multiplier */} - - - - onConfigChange(MULTIPLIER, Math.max(1, config.multiplier - 1))} - disabled={config.multiplier <= 1} - > - − - -
- {config.multiplier < 2 ? "OFF" : `${config.multiplier}X`} -
- onConfigChange(MULTIPLIER, Math.min(6, config.multiplier + 1))} - disabled={config.multiplier >= 6} - > - + - -
-
+ Promise; +} + +export function FpsMultiplierControl({ + config, + onConfigChange +}: FpsMultiplierControlProps) { + return ( + + + onConfigChange(MULTIPLIER, Math.max(1, config.multiplier - 1))} + disabled={config.multiplier <= 1} + > + − + +
+ {config.multiplier < 2 ? "OFF" : `${config.multiplier}X`} +
+ onConfigChange(MULTIPLIER, Math.min(6, config.multiplier + 1))} + disabled={config.multiplier >= 6} + > + + + +
+
+ ); +} diff --git a/src/components/index.ts b/src/components/index.ts index e4568f1..4c94958 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -2,6 +2,7 @@ export { Content } from "./Content"; export { StatusDisplay } from "./StatusDisplay"; export { InstallationButton } from "./InstallationButton"; export { ConfigurationSection } from "./ConfigurationSection"; +export { FpsMultiplierControl } from "./FpsMultiplierControl"; export { UsageInstructions } from "./UsageInstructions"; export { WikiButton } from "./WikiButton"; export { SmartClipboardButton } from "./SmartClipboardButton"; -- cgit v1.2.3