From e69283e3eda7fb20564984edde4d15723b85e3f7 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 29 Jan 2026 23:52:21 +0000 Subject: [PATCH] sliders --- client/src/Components/v2/inputs/Slider.tsx | 41 +++++++++++++++ client/src/Components/v2/inputs/index.tsx | 1 + client/src/Pages/CreateMonitor/index.tsx | 61 +++++++++++----------- 3 files changed, 73 insertions(+), 30 deletions(-) create mode 100644 client/src/Components/v2/inputs/Slider.tsx diff --git a/client/src/Components/v2/inputs/Slider.tsx b/client/src/Components/v2/inputs/Slider.tsx new file mode 100644 index 000000000..11b3e8db8 --- /dev/null +++ b/client/src/Components/v2/inputs/Slider.tsx @@ -0,0 +1,41 @@ +import { forwardRef } from "react"; +import Slider from "@mui/material/Slider"; +import type { SliderProps } from "@mui/material/Slider"; +import { useTheme } from "@mui/material/styles"; + +export const SliderInput = forwardRef( + function SliderInput({ sx, ...props }, ref) { + const theme = useTheme(); + const additionalSx = Array.isArray(sx) ? sx : sx ? [sx] : []; + + return ( + + ); + } +); diff --git a/client/src/Components/v2/inputs/index.tsx b/client/src/Components/v2/inputs/index.tsx index 4bfd62947..1618daf76 100644 --- a/client/src/Components/v2/inputs/index.tsx +++ b/client/src/Components/v2/inputs/index.tsx @@ -11,3 +11,4 @@ export { export { DialogInput as Dialog } from "./Dialog"; export * from "./Radio"; export * from "./Switch"; +export * from "./Slider"; diff --git a/client/src/Pages/CreateMonitor/index.tsx b/client/src/Pages/CreateMonitor/index.tsx index c0740393b..215cdab5f 100644 --- a/client/src/Pages/CreateMonitor/index.tsx +++ b/client/src/Pages/CreateMonitor/index.tsx @@ -22,6 +22,7 @@ import { Select, Autocomplete, SwitchComponent as Switch, + SliderInput as Slider, } from "@/Components/v2/inputs"; import { useGet } from "@/Hooks/UseApi"; import { useMonitorForm } from "@/Hooks/useMonitorForm"; @@ -340,7 +341,9 @@ const CreateMonitorPage = () => {