refactor: update button styles in Counter component and improve Badge variant handling in forms
This commit is contained in:
parent
7c88d0af86
commit
b741f7ce72
3 changed files with 10 additions and 18 deletions
|
|
@ -26,7 +26,7 @@ export const Counter = ({
|
||||||
|
|
||||||
<div className="flex items-center rounded-md border px-1">
|
<div className="flex items-center rounded-md border px-1">
|
||||||
<button
|
<button
|
||||||
className="flex size-10 items-center justify-center leading-10 transition hover:opacity-75 disabled:opacity-50"
|
className="flex size-10 cursor-pointer items-center justify-center leading-10 transition hover:opacity-75 disabled:opacity-50"
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onClick={() => handleChange(-1)}
|
onClick={() => handleChange(-1)}
|
||||||
type="button"
|
type="button"
|
||||||
|
|
@ -50,7 +50,7 @@ export const Counter = ({
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
className="flex size-10 items-center justify-center leading-10 transition hover:opacity-75 disabled:opacity-50"
|
className="flex size-10 cursor-pointer items-center justify-center leading-10 transition hover:opacity-75 disabled:opacity-50"
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onClick={() => handleChange(1)}
|
onClick={() => handleChange(1)}
|
||||||
type="button"
|
type="button"
|
||||||
|
|
|
||||||
|
|
@ -207,9 +207,9 @@ export const FormNewServizio = ({
|
||||||
onValueChange={(vals) => {
|
onValueChange={(vals) => {
|
||||||
field.onChange(Number(vals[0]));
|
field.onChange(Number(vals[0]));
|
||||||
}}
|
}}
|
||||||
rangeClassName="bg-neutral-700"
|
rangeClassName="bg-primary"
|
||||||
step={50}
|
step={50}
|
||||||
thumbClassName="border-neutral-700"
|
thumbClassName="border-primary"
|
||||||
value={[form.getValues("budget")]}
|
value={[form.getValues("budget")]}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|
@ -574,15 +574,11 @@ export const FormNewServizio = ({
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Badge
|
<Badge
|
||||||
className={cn(
|
className={cn("cursor-pointer text-sm")}
|
||||||
"cursor-pointer text-sm",
|
|
||||||
field.value
|
|
||||||
? "bg-neutral-800 hover:bg-neutral-800 sm:hover:bg-neutral-900/80"
|
|
||||||
: "bg-neutral-200 text-neutral-700 hover:bg-neutral-200 sm:hover:bg-neutral-900/80 sm:hover:text-neutral-50",
|
|
||||||
)}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
field.onChange(!field.value);
|
field.onChange(!field.value);
|
||||||
}}
|
}}
|
||||||
|
variant={field.value ? "default" : "secondary"}
|
||||||
>
|
>
|
||||||
{pair[1]}
|
{pair[1]}
|
||||||
</Badge>
|
</Badge>
|
||||||
|
|
|
||||||
|
|
@ -811,7 +811,7 @@ export const FormNewServizioAcquisto = ({
|
||||||
"h-[42px] w-full pl-3 text-left font-medium",
|
"h-[42px] w-full pl-3 text-left font-medium",
|
||||||
!field.value && "text-muted-foreground",
|
!field.value && "text-muted-foreground",
|
||||||
"rounded-lg border border-neutral-300 shadow-xs outline-hidden file:border-0 file:bg-transparent file:font-medium file:text-sm disabled:cursor-not-allowed disabled:opacity-50 dark:focus:border-transparent",
|
"rounded-lg border border-neutral-300 shadow-xs outline-hidden file:border-0 file:bg-transparent file:font-medium file:text-sm disabled:cursor-not-allowed disabled:opacity-50 dark:focus:border-transparent",
|
||||||
)}
|
)}
|
||||||
id="scadenza_motivazione_transitoria"
|
id="scadenza_motivazione_transitoria"
|
||||||
variant={"outline"}
|
variant={"outline"}
|
||||||
>
|
>
|
||||||
|
|
@ -892,15 +892,11 @@ export const FormNewServizioAcquisto = ({
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Badge
|
<Badge
|
||||||
className={cn(
|
className={cn("cursor-pointer text-sm")}
|
||||||
"cursor-pointer text-sm",
|
|
||||||
field.value
|
|
||||||
? "bg-neutral-800 hover:bg-neutral-800 sm:hover:bg-neutral-900/80"
|
|
||||||
: "bg-neutral-200 text-neutral-700 hover:bg-neutral-200 sm:hover:bg-neutral-900/80 sm:hover:text-neutral-50",
|
|
||||||
)}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
field.onChange(!field.value);
|
field.onChange(!field.value);
|
||||||
}}
|
}}
|
||||||
|
variant={field.value ? "default" : "secondary"}
|
||||||
>
|
>
|
||||||
{pair[1]}
|
{pair[1]}
|
||||||
</Badge>
|
</Badge>
|
||||||
|
|
@ -1011,7 +1007,7 @@ export const FormNewServizioAcquisto = ({
|
||||||
"h-[42px] w-full pl-3 text-left font-medium",
|
"h-[42px] w-full pl-3 text-left font-medium",
|
||||||
!field.value && "text-muted-foreground",
|
!field.value && "text-muted-foreground",
|
||||||
"rounded-lg border border-neutral-300 shadow-xs outline-hidden file:border-0 file:bg-transparent file:font-medium file:text-sm disabled:cursor-not-allowed disabled:opacity-50 dark:focus:border-transparent",
|
"rounded-lg border border-neutral-300 shadow-xs outline-hidden file:border-0 file:bg-transparent file:font-medium file:text-sm disabled:cursor-not-allowed disabled:opacity-50 dark:focus:border-transparent",
|
||||||
)}
|
)}
|
||||||
id="dataNascita"
|
id="dataNascita"
|
||||||
variant={"outline"}
|
variant={"outline"}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue