From 49ebeb28d61a25aede2a8dad6bfdee90ebc920de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Mon, 30 Dec 2024 16:47:30 +0800 Subject: [PATCH] =?UTF-8?q?SegmentedControl=E7=BB=84=E4=BB=B6=E6=9B=B4?= =?UTF-8?q?=E5=90=8D=E4=B8=BAHSegmentedControl=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ColorStand.tsx | 4 ++-- ...gmentedControl.module.css => HSegmentedControl.module.css} | 0 .../{SegmentedControl.tsx => HSegmentedControl.tsx} | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename src/components/{SegmentedControl.module.css => HSegmentedControl.module.css} (100%) rename src/components/{SegmentedControl.tsx => HSegmentedControl.tsx} (92%) diff --git a/src/components/ColorStand.tsx b/src/components/ColorStand.tsx index e6f0eef..947fa1c 100644 --- a/src/components/ColorStand.tsx +++ b/src/components/ColorStand.tsx @@ -5,8 +5,8 @@ import { useCopyToClipboard } from 'react-use'; import NoColor from '../assets/NoColor.svg'; import { useColorFunction } from '../ColorFunctionContext'; import styles from './ColorStand.module.css'; +import { HSegmentedControl } from './HSegmentedControl'; import { NotificationType, useNotification } from './Notifications'; -import { SegmentedControl } from './SegmentedControl'; type ColorValueProps = { value: string | null; @@ -102,7 +102,7 @@ export function ColorStand({ title, color }: ColorStandProps) {
- void; }; -export function SegmentedControl({ options = [], value, onChange }: SegmentedConttrolProps) { +export function HSegmentedControl({ options = [], value, onChange }: SegmentedConttrolProps) { const [selected, setSelected] = useState(value ?? options[0].value ?? null); const [sliderPosition, setSliderPosition] = useState(0); const [sliderWidth, setSliderWidth] = useState(0);