fix: hide clickable booking url in webview
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
|
import { usePathname } from "next/navigation"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
|
import { webviews } from "@/constants/routes/webviews"
|
||||||
import { dt } from "@/lib/dt"
|
import { dt } from "@/lib/dt"
|
||||||
|
|
||||||
import Link from "@/components/TempDesignSystem/Link"
|
import Link from "@/components/TempDesignSystem/Link"
|
||||||
@@ -17,6 +19,8 @@ import { RewardTransactionTypes } from "@/types/components/myPages/myPage/enums"
|
|||||||
export default function Row({ transaction }: RowProps) {
|
export default function Row({ transaction }: RowProps) {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
const lang = useLang()
|
const lang = useLang()
|
||||||
|
const pathName = usePathname()
|
||||||
|
const isWebview = webviews.includes(pathName)
|
||||||
|
|
||||||
const nightString = `${transaction.nights} ${transaction.nights === 1 ? intl.formatMessage({ id: "night" }) : intl.formatMessage({ id: "nights" })}`
|
const nightString = `${transaction.nights} ${transaction.nights === 1 ? intl.formatMessage({ id: "night" }) : intl.formatMessage({ id: "nights" })}`
|
||||||
|
|
||||||
@@ -60,6 +64,7 @@ export default function Row({ transaction }: RowProps) {
|
|||||||
if (transaction.confirmationNumber === "BALFWD") return null
|
if (transaction.confirmationNumber === "BALFWD") return null
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
!isWebview &&
|
||||||
transaction.bookingUrl &&
|
transaction.bookingUrl &&
|
||||||
(transaction.type === RewardTransactionTypes.stay ||
|
(transaction.type === RewardTransactionTypes.stay ||
|
||||||
transaction.type === RewardTransactionTypes.rewardNight)
|
transaction.type === RewardTransactionTypes.rewardNight)
|
||||||
|
|||||||
Reference in New Issue
Block a user