Merged in feat/SW-1261 (pull request #1263)
feat: only show member price when logged in * feat: only show member price when logged in Approved-by: Michael Zetterberg
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
"use client"
|
||||
import { useSession } from "next-auth/react"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { selectRate } from "@/constants/routes/hotelReservation"
|
||||
@@ -5,7 +7,6 @@ import { selectRate } from "@/constants/routes/hotelReservation"
|
||||
import { mapFacilityToIcon } from "@/components/ContentType/HotelPage/data"
|
||||
import Button from "@/components/TempDesignSystem/Button"
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||
|
||||
@@ -31,6 +32,8 @@ export default function ListingHotelCardDialog({
|
||||
setImageError,
|
||||
}: ListingHotelCardProps) {
|
||||
const intl = useIntl()
|
||||
const { data: session } = useSession()
|
||||
const isUserLoggedIn = !!session
|
||||
const {
|
||||
name,
|
||||
publicPrice,
|
||||
@@ -85,12 +88,14 @@ export default function ListingHotelCardDialog({
|
||||
{intl.formatMessage({ id: "Per night from" })}
|
||||
</Caption>
|
||||
<div className={styles.listingPrices}>
|
||||
{publicPrice && (
|
||||
<Subtitle type="two">
|
||||
{publicPrice} {currency}
|
||||
</Subtitle>
|
||||
{publicPrice && !isUserLoggedIn && (
|
||||
<>
|
||||
<Subtitle type="two">
|
||||
{publicPrice} {currency}
|
||||
</Subtitle>
|
||||
{memberPrice && <Caption>/</Caption>}
|
||||
</>
|
||||
)}
|
||||
{publicPrice && memberPrice && <Caption>/</Caption>}
|
||||
{memberPrice && (
|
||||
<Subtitle type="two" color="red" className={styles.memberPrice}>
|
||||
{intl.formatMessage(
|
||||
|
||||
Reference in New Issue
Block a user