Skip to content

Commit

Permalink
fix: remove prefetch from calendar link
Browse files Browse the repository at this point in the history
  • Loading branch information
joonatank committed Nov 16, 2024
1 parent 9dd73d1 commit 6244b75
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
6 changes: 6 additions & 0 deletions apps/ui/components/common/ButtonLikeLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ export const ButtonLikeLink = styled(Link)<ButtonStyleProps>`
${fontMedium}
gap: var(--spacing-s);
`;

export const ButtonLikeExternalLink = styled.a<ButtonStyleProps>`
${ButtonCss}
${fontMedium}
gap: var(--spacing-s);
`;
7 changes: 3 additions & 4 deletions apps/ui/components/reservation/ReservationConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { getReservationUnitInstructionsKey } from "@/modules/reservationUnit";
import { getTranslation } from "@/modules/util";
import { BlackButton } from "@/styles/util";
import { Paragraph } from "./styles";
import { ButtonLikeLink } from "../common/ButtonLikeLink";
import { ButtonLikeExternalLink } from "../common/ButtonLikeLink";
import { getReservationUnitPath, reservationsPath } from "@/modules/urls";

type Node = NonNullable<ReservationQuery["reservation"]>;
Expand Down Expand Up @@ -140,16 +140,15 @@ function ReservationConfirmation({
</Paragraph>
{reservation.state === ReservationStateChoice.Confirmed && (
<ActionContainer1 style={{ marginBottom: "var(--spacing-2-xl)" }}>
<ButtonLikeLink
<ButtonLikeExternalLink
size="large"
disabled={!reservation.calendarUrl}
data-testid="reservation__confirmation--button__calendar-url"
href={reservation.calendarUrl ?? ""}
locale={false}
>
{t("reservations:saveToCalendar")}
<IconCalendar aria-hidden />
</ButtonLikeLink>
</ButtonLikeExternalLink>
{order?.receiptUrl && (
<BlackButton
data-testid="reservation__confirmation--button__receipt-link"
Expand Down
9 changes: 6 additions & 3 deletions apps/ui/pages/reservations/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ import {
import { base64encode, filterNonNullable } from "common/src/helpers";
import { containsField, containsNameField } from "common/src/metaFieldsHelpers";
import { NotModifiableReason } from "@/components/reservation/NotModifiableReason";
import { ButtonLikeLink } from "@/components/common/ButtonLikeLink";
import {
ButtonLikeLink,
ButtonLikeExternalLink,
} from "@/components/common/ButtonLikeLink";
import { useRouter } from "next/router";
import { successToast } from "common/src/common/toast";
import { ReservationPageWrapper } from "@/components/reservations/styles";
Expand Down Expand Up @@ -514,14 +517,14 @@ function Reservation({
</ButtonLikeLink>
)}
{canTimeBeModified && (
<ButtonLikeLink
<ButtonLikeExternalLink
size="large"
href={getReservationPath(reservation.pk, "edit")}
data-testid="reservation-detail__button--edit"
>
{t("reservations:modifyReservationTime")}
<IconCalendar aria-hidden />
</ButtonLikeLink>
</ButtonLikeExternalLink>
)}
{isCancellable && (
<ButtonLikeLink
Expand Down

0 comments on commit 6244b75

Please sign in to comment.