Merged in feat(SW-1944)-update-url-to-mystay (pull request #1566)
feat(SW-1944) Update to correct URL to my stay (for my pages/my stays and confirmation page) * feat(SW-1944) Update to correct URL to my stay (for my pages/my stays and confirmation page) * feat(SW-1944) updated to RefId * feat(SW-1944) updated myStay path * feat(SW-1944) updated refId check Approved-by: Christian Andolf
This commit is contained in:
@@ -1,23 +1,15 @@
|
||||
"use client"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { myBooking } from "@/constants/myBooking"
|
||||
import { env } from "@/env/client"
|
||||
|
||||
import { EditIcon } from "@/components/Icons"
|
||||
import Button from "@/components/TempDesignSystem/Button"
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
import useLang from "@/hooks/useLang"
|
||||
|
||||
import type { ManageBookingProps } from "@/types/components/hotelReservation/bookingConfirmation/actions/manageBooking"
|
||||
|
||||
export default function ManageBooking({
|
||||
confirmationNumber,
|
||||
lastName,
|
||||
}: ManageBookingProps) {
|
||||
export default function ManageBooking({ bookingUrl }: ManageBookingProps) {
|
||||
const intl = useIntl()
|
||||
const lang = useLang()
|
||||
const myBookingUrl = myBooking[env.NEXT_PUBLIC_NODE_ENV][lang]
|
||||
|
||||
return (
|
||||
<Button
|
||||
asChild
|
||||
@@ -27,11 +19,7 @@ export default function ManageBooking({
|
||||
variant="icon"
|
||||
wrapping
|
||||
>
|
||||
<Link
|
||||
color="none"
|
||||
href={`${myBookingUrl}?bookingId=${confirmationNumber}&lastName=${lastName}`}
|
||||
weight="bold"
|
||||
>
|
||||
<Link color="none" href={bookingUrl} weight="bold">
|
||||
<EditIcon />
|
||||
{intl.formatMessage({ id: "Manage booking" })}
|
||||
</Link>
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
"use client"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { myStay } from "@/constants/routes/myStay"
|
||||
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
import useLang from "@/hooks/useLang"
|
||||
|
||||
import AddToCalendar from "../../AddToCalendar"
|
||||
import AddToCalendarButton from "./Actions/AddToCalendarButton"
|
||||
@@ -22,8 +25,10 @@ export default function Header({
|
||||
booking,
|
||||
hotel,
|
||||
mainRef,
|
||||
refId,
|
||||
}: BookingConfirmationHeaderProps) {
|
||||
const intl = useIntl()
|
||||
const lang = useLang()
|
||||
|
||||
const text = intl.formatMessage(
|
||||
{
|
||||
@@ -57,6 +62,8 @@ export default function Header({
|
||||
url: hotel.contactInformation.websiteUrl,
|
||||
}
|
||||
|
||||
const bookingUrlPath = `${myStay[lang]}?RefId=${refId}`
|
||||
|
||||
return (
|
||||
<header className={styles.header}>
|
||||
<hgroup className={styles.hgroup}>
|
||||
@@ -83,10 +90,7 @@ export default function Header({
|
||||
hotelName={hotel.name}
|
||||
renderButton={(onPress) => <AddToCalendarButton onPress={onPress} />}
|
||||
/>
|
||||
<ManageBooking
|
||||
confirmationNumber={booking.confirmationNumber}
|
||||
lastName={booking.guest.lastName}
|
||||
/>
|
||||
<ManageBooking bookingUrl={bookingUrlPath} />
|
||||
<DownloadInvoice mainRef={mainRef} />
|
||||
</div>
|
||||
</header>
|
||||
|
||||
Reference in New Issue
Block a user