Skip to content

Commit 2c4db37

Browse files
committed
fix(arc): label closing
1 parent 5ecb67b commit 2c4db37

3 files changed

Lines changed: 11 additions & 8 deletions

File tree

src/features/abstract-resource-calendar/components/arc-event-card.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export function EventCard({
4646
{event.googleCalId == null ? null : (
4747
<ArcHideButtonWithDialog
4848
resource={resource as EditableResource}
49-
id={event.id}
5049
googleCalId={event.googleCalId}
5150
hidden={event.hidden}
5251
/>

src/features/abstract-resource-calendar/components/arc-hide-button-with-dialog.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,13 @@ import { fetchMutation, getKey, useMutationWrapper } from "@/features/backend";
2323
import type { MessageResponse } from "@/features/backend/types";
2424
import { GrammaticalCase, declineNoun } from "@/features/polish";
2525
import type { Resource } from "@/features/resources";
26-
import type { ResourcePk } from "@/features/resources/types";
2726
import { useRouter } from "@/hooks/use-router";
2827
import { getToastMessages } from "@/lib/get-toast-messages";
2928
import type { OptionalPromise } from "@/types/helpers";
3029
import { quoteText } from "@/utils";
3130

3231
export function ArcHideButtonWithDialog({
3332
resource,
34-
id,
3533
googleCalId,
3634
hidden,
3735
itemName,
@@ -40,7 +38,6 @@ export function ArcHideButtonWithDialog({
4038
...props
4139
}: {
4240
resource: Resource;
43-
id: ResourcePk;
4441
googleCalId: string;
4542
hidden: boolean;
4643
itemName?: string;
@@ -50,7 +47,7 @@ export function ArcHideButtonWithDialog({
5047
const [isAlertDialogOpen, setIsAlertDialogOpen] = useState(false);
5148
const router = useRouter();
5249
const queryClient = useQueryClient();
53-
const { mutateAsync, isPending, isSuccess } = useMutationWrapper<
50+
const { mutateAsync, isPending } = useMutationWrapper<
5451
MessageResponse,
5552
string
5653
>(getKey.mutation.hideResource(resource, googleCalId), async (calId) => {
@@ -96,7 +93,11 @@ export function ArcHideButtonWithDialog({
9693
{hidden ? <Eye /> : <EyeOff />}
9794
</Button>
9895
</AlertDialogTrigger>
99-
<AlertDialogContent>
96+
<AlertDialogContent
97+
onCloseAutoFocus={(event) => {
98+
event.preventDefault();
99+
}}
100+
>
100101
<AlertDialogHeader>
101102
<AlertDialogTitle className="text-balance">
102103
{hidden
@@ -125,7 +126,6 @@ export function ArcHideButtonWithDialog({
125126
variant="destructive"
126127
onClick={handleHide}
127128
loading={isPending}
128-
disabled={isSuccess}
129129
>
130130
{hidden ? (
131131
<>

src/features/resources/components/delete-button-with-dialog.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ export function DeleteButtonWithDialog({
9191
<Trash2 />
9292
</Button>
9393
</AlertDialogTrigger>
94-
<AlertDialogContent>
94+
<AlertDialogContent
95+
onCloseAutoFocus={(event) => {
96+
event.preventDefault();
97+
}}
98+
>
9599
<AlertDialogHeader>
96100
<AlertDialogTitle className="text-balance">
97101
Czy na pewno chcesz usunąć{" "}

0 commit comments

Comments
 (0)