Merged in feat(SW-1722)-mystay-multiroom-view (pull request #1396)
Feat(SW-1722) mystay multiroom view * feat(SW-1722) View all rooms on my stay * feat(sW-1722) Show linked reservation * feat(SW-1722) merged monorepo * feat(SW-1722) yarn install * feat(SW-1722) removed unused data * feat(SW-1722) Streaming data from the server to the client Approved-by: Niclas Edenvin
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
"use client"
|
||||
|
||||
import { useEffect } from "react"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { dt } from "@/lib/dt"
|
||||
|
||||
import {
|
||||
@@ -12,10 +17,10 @@ import Body from "@/components/TempDesignSystem/Text/Body"
|
||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||
import { Toast } from "@/components/TempDesignSystem/Toasts"
|
||||
import { getIntl } from "@/i18n"
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
import useLang from "@/hooks/useLang"
|
||||
import { formatPrice } from "@/utils/numberFormatting"
|
||||
|
||||
import { useMyStayTotalPriceStore } from "../stores/myStayTotalPrice"
|
||||
import SummaryCard from "./SummaryCard"
|
||||
|
||||
import styles from "./bookingSummary.module.css"
|
||||
@@ -28,12 +33,22 @@ interface BookingSummaryProps {
|
||||
hotel: Hotel
|
||||
}
|
||||
|
||||
export default async function BookingSummary({
|
||||
export default function BookingSummary({
|
||||
booking,
|
||||
hotel,
|
||||
}: BookingSummaryProps) {
|
||||
const intl = await getIntl()
|
||||
const lang = getLang()
|
||||
const intl = useIntl()
|
||||
const lang = useLang()
|
||||
const { totalPrice, currencyCode, addRoomPrice } = useMyStayTotalPriceStore()
|
||||
|
||||
useEffect(() => {
|
||||
addRoomPrice({
|
||||
id: booking.confirmationNumber ?? "",
|
||||
totalPrice: booking.totalPrice,
|
||||
currencyCode: booking.currencyCode,
|
||||
isMainBooking: true,
|
||||
})
|
||||
}, [booking, addRoomPrice])
|
||||
|
||||
const directionsUrl = `https://www.google.com/maps/dir/?api=1&destination=${hotel.location.latitude},${hotel.location.longitude}`
|
||||
const isPaid =
|
||||
@@ -49,7 +64,7 @@ export default async function BookingSummary({
|
||||
</Subtitle>
|
||||
<div className={styles.bookingSummaryContent}>
|
||||
<SummaryCard
|
||||
title={formatPrice(intl, booking.totalPrice, booking.currencyCode)}
|
||||
title={formatPrice(intl, totalPrice, currencyCode)}
|
||||
image={{
|
||||
src: "/_static/img/scandic-coin.svg",
|
||||
alt: "Scandic coin",
|
||||
|
||||
Reference in New Issue
Block a user