diff --git a/src/components/form/SwitchInput/SwitchInput.module.css b/src/components/form/SwitchInput/SwitchInput.module.css index f239852..099dbef 100644 --- a/src/components/form/SwitchInput/SwitchInput.module.css +++ b/src/components/form/SwitchInput/SwitchInput.module.css @@ -45,6 +45,7 @@ position: absolute; top: 0; height: 100%; + width: 50%; border-radius: 9999px; z-index: 0; } diff --git a/src/components/form/SwitchInput/SwitchInput.tsx b/src/components/form/SwitchInput/SwitchInput.tsx index 9b792da..539f95f 100644 --- a/src/components/form/SwitchInput/SwitchInput.tsx +++ b/src/components/form/SwitchInput/SwitchInput.tsx @@ -6,6 +6,7 @@ import { motion, type HTMLMotionProps } from "motion/react"; import classes from "./SwitchInput.module.css"; import tg from "@/tg"; +import { useRef } from "react"; type Props = Omit, "className" | "onChange"> & { value?: boolean | null; @@ -15,7 +16,8 @@ type Props = Omit, "className" | "onChange"> & { export default function SwitchInput({ value, onChange, className, ...props }: Props) { const { t } = useTranslation(); - const selectedIndex = value != null ? (value ? 0 : 1) : -1; + const selectedIndex = value != null ? (value ? 0 : 1) : 0; + const selectedIndexRef = useRef(selectedIndex); return ( = 0 && ( )} diff --git a/src/routes/-/RootLayout/RootLayout.module.css b/src/routes/-/RootLayout/RootLayout.module.css index 2dcf658..8b00347 100644 --- a/src/routes/-/RootLayout/RootLayout.module.css +++ b/src/routes/-/RootLayout/RootLayout.module.css @@ -4,7 +4,7 @@ height: 100%; width: 100%; - background-image: url("./assets/main-bg.png"); + background-image: url("./assets/main-bg.svg"); background-size: auto 101%; background-position: center; overflow: hidden;