update switch

This commit is contained in:
Eduard Gert
2026-05-07 17:27:56 +02:00
parent 2c5d52a1bf
commit adeaa49cda
3 changed files with 51 additions and 33 deletions

View File

@@ -27,13 +27,11 @@ export const SwitchItem = ({ value, children }: Props) => {
{active && (
<motion.span
layoutId={layoutId}
className={"absolute inset-0 rounded-md bg-nb-gray-800"}
className={"absolute inset-0 rounded-md bg-nb-gray-700"}
transition={{ type: "spring", stiffness: 500, damping: 35 }}
/>
)}
<span
className={"relative inline-flex items-center justify-center gap-1"}
>
<span className={"relative inline-flex items-center justify-center gap-1"}>
{children}
</span>
</RadioGroup.Item>

View File

@@ -7,9 +7,7 @@ type SwitchItemGroupContextValue = {
layoutId: string;
};
const SwitchItemGroupContext = createContext<SwitchItemGroupContextValue | null>(
null,
);
const SwitchItemGroupContext = createContext<SwitchItemGroupContextValue | null>(null);
export const useSwitchItemGroup = () => {
const ctx = useContext(SwitchItemGroupContext);
@@ -35,7 +33,7 @@ export const SwitchItemGroup = ({ value, onChange, children, className }: Props)
value={value}
onValueChange={onChange}
className={cn(
"flex shrink-0 rounded-lg border border-nb-gray-850 bg-nb-gray-920 p-1",
"flex shrink-0 rounded-lg border border-nb-gray-850 bg-nb-gray-910 p-1",
className,
)}
>