Files
medusa-store/packages/admin-ui/ui/src/components/atoms/switch/index.tsx
Kasper Fabricius Kristensen bfef22b33e fix(admin-ui): Gift Card manage page (#3532)
**What**
- Updates GC manage page to use product page sections
- Revamps Denomination section
- Updates the location of several components to reflect that they are now shared between the GC and products domain

![image](https://user-images.githubusercontent.com/45367945/226584238-bb0786b1-d21c-4b90-b00b-29530af320f4.png)
![image](https://user-images.githubusercontent.com/45367945/226584362-80c0c9f8-4ec5-4e64-9075-110caa3b5137.png)

Resolves CORE-1089
2023-03-23 08:29:29 +00:00

31 lines
762 B
TypeScript

import * as RadixSwitch from "@radix-ui/react-switch"
import clsx from "clsx"
import React from "react"
/**
* A controlled switch component atom.
*/
const Switch = React.forwardRef<HTMLButtonElement, RadixSwitch.SwitchProps>(
(props, ref) => {
return (
<RadixSwitch.Root
ref={ref}
{...props}
className={clsx(
"transition-bg radix-state-checked:bg-violet-60 h-[18px] w-8 rounded-full bg-gray-300"
)}
>
<RadixSwitch.Thumb
className={clsx(
"radix-state-checked:translate-x-[19px] block h-2 w-2 translate-x-[5px] rounded-full bg-white transition-transform"
)}
/>
</RadixSwitch.Root>
)
}
)
Switch.displayName = "Switch"
export default Switch