fix(LOY-52): remove spinner on stay cards to prevent loading to spin indefinitely when opening link in a new tab
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
"use client"
|
||||
|
||||
import { useState } from "react"
|
||||
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
|
||||
import { dt } from "@/lib/dt"
|
||||
|
||||
import Image from "@/components/Image"
|
||||
import LoadingSpinner from "@/components/LoadingSpinner"
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
@@ -18,9 +15,6 @@ import styles from "./stay.module.css"
|
||||
import type { StayCardProps } from "@/types/components/myPages/stays/stayCard"
|
||||
|
||||
export default function StayCard({ stay }: StayCardProps) {
|
||||
// TODO: Temporary loading. Remove when current web is deleted.
|
||||
const [loading, setLoading] = useState(false)
|
||||
|
||||
const { bookingUrl, isWebAppOrigin } = stay.attributes
|
||||
|
||||
const shouldLinkToMyStay = isWebAppOrigin
|
||||
@@ -30,17 +24,8 @@ export default function StayCard({ stay }: StayCardProps) {
|
||||
}
|
||||
|
||||
return (
|
||||
<Link
|
||||
href={bookingUrl}
|
||||
className={styles.link}
|
||||
onClick={() => setLoading(true)}
|
||||
>
|
||||
<Link href={bookingUrl} className={styles.link}>
|
||||
<CardContent stay={stay} />
|
||||
{loading && (
|
||||
<div className={styles.loadingcontainer}>
|
||||
<LoadingSpinner />
|
||||
</div>
|
||||
)}
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user