update src/components/CustomSwitch/index.js and src/components/FormInput/index.js

master
mahdi 2 years ago
parent 942a861b46
commit 1f641bd7d9
  1. 17
      src/components/CustomSwitch/index.js
  2. 2
      src/components/FormInput/index.js

@ -18,10 +18,10 @@ const CustomSwitch = ({
setValue(!value);
register.onChange({ target: { name: register.name, value: !value } });
}}
className={`${className} flex border border-blue-500 relative ${
className={`${className} flex border relative w-full ${
values
? "rounded h-full min-h-[50px]"
: " rounded-full h-9 aspect-[1/2]"
? "rounded-md h-full min-h-[50px]"
: " rounded-md h-9 aspect-[1/2]"
}`}
>
<input
@ -40,21 +40,20 @@ const CustomSwitch = ({
: "h-[89%] rounded-full aspect-square"
}`}
></div>
{values ? (
<div className=" w-[98%] h-[90%] flex flex-row-reverse right-[1%] top-[5%] z-10 absolute text-color19">
<div className=" w-[98%] h-[90%] flex flex-row-reverse right-[1%] top-[5%] z-10 absolute text-white">
<div
className={
" w-1/2 h-full flex items-center justify-center cursor-pointer " +
(value ? "text-white" : "")
" w-1/2 h-full flex items-center justify-center cursor-pointer text-xs" +
(value ? "text-[#2483E1]" : "")
}
>
{values[1]}
</div>
<div
className={
" w-1/2 h-full flex items-center justify-center cursor-pointer " +
(!value ? "text-white" : "")
" w-1/2 h-full flex items-center justify-center cursor-pointer text-xs" +
(!value ? "text-[#2483E1]" : "")
}
>
{values[0]}

@ -43,7 +43,7 @@ const FormInput = ({ items }) => {
<CustomSelectBox />
<CustomSwitch
register={register("gender")}
className="flex-1 mx-5"
className="flex-1 bg-[#F9F9F9] border-[#E0E0E0]"
// defaultValue={activeUser?.gender}
values={["خانم", "آقا"]}
/>

Loading…
Cancel
Save