Fixed dark mode bugs in the availability section (#8630)
* Fixed dark mode bugs in the availability section * Reverted the tooltip change for delete button * Updated tooltip of delete button conditionally based on isLastSchedule flag * fix: disabled button state Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> --------- Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> Co-authored-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>pull/8506/head^2
parent
5e772530b2
commit
69bc12187e
|
@ -212,7 +212,7 @@ export default function Availability() {
|
|||
aria-label={t("delete")}
|
||||
className="hidden sm:inline"
|
||||
disabled={schedule?.isLastSchedule}
|
||||
tooltip={t("requires_at_least_one_schedule")}
|
||||
tooltip={schedule?.isLastSchedule ? t("requires_at_least_one_schedule") : t("delete")}
|
||||
/>
|
||||
</DialogTrigger>
|
||||
<ConfirmationDialogContent
|
||||
|
|
|
@ -215,6 +215,7 @@ const RemoveTimeButton = ({
|
|||
remove: UseFieldArrayRemove;
|
||||
className?: string;
|
||||
}) => {
|
||||
const { t } = useLocale();
|
||||
return (
|
||||
<Button
|
||||
type="button"
|
||||
|
@ -223,6 +224,7 @@ const RemoveTimeButton = ({
|
|||
StartIcon={Trash}
|
||||
onClick={() => remove(index)}
|
||||
className={className}
|
||||
tooltip={t("delete")}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -115,11 +115,6 @@ const buttonClasses = cva(
|
|||
"hover:bg-subtle focus-visible:bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset focus-visible:ring-empthasis",
|
||||
}),
|
||||
// Destructive variants
|
||||
{
|
||||
disabled: true,
|
||||
color: "destructive",
|
||||
className: "text-red-700/30 hover:text-red-700/30 border border-default text-emphasis",
|
||||
},
|
||||
{
|
||||
loading: true,
|
||||
color: "destructive",
|
||||
|
@ -127,7 +122,7 @@ const buttonClasses = cva(
|
|||
"text-red-700/30 dark:text-red-700/30 hover:text-red-700/30 border border-default text-emphasis",
|
||||
},
|
||||
...applyStyleToMultipleVariants({
|
||||
disabled: [false, undefined],
|
||||
disabled: [false, true, undefined],
|
||||
color: "destructive",
|
||||
className:
|
||||
"border border-default text-emphasis hover:text-red-700 focus-visible:text-red-700 hover:border-red-100 focus-visible:border-red-100 hover:bg-error focus-visible:bg-error focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset focus-visible:ring-red-700",
|
||||
|
|
Loading…
Reference in New Issue