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
Mahesh Bansode 2023-05-14 23:16:19 +05:30 committed by GitHub
parent 5e772530b2
commit 69bc12187e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 7 deletions

View File

@ -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

View File

@ -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")}
/>
);
};

View File

@ -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",