Merged in feat/LOY-522-move-focus-to-newly-loaded-item (pull request #3452)
feat(LOY-522): Move focus to the newly loaded stay in sidepeek for upcoming and previous stay * feat(LOY-522): Moved focus to the newly loaded stay in sidepeek for upcoming and previous stay Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import Link from "next/link"
|
||||
import { Link } from "react-aria-components"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { dt } from "@scandic-hotels/common/dt"
|
||||
@@ -16,7 +16,7 @@ import styles from "./stayCard.module.css"
|
||||
|
||||
import type { StayCardProps } from "@/types/components/myPages/stays/stayCard"
|
||||
|
||||
export function StayCard({ stay }: StayCardProps) {
|
||||
export function StayCard({ stay, ref }: StayCardProps) {
|
||||
const { bookingUrl, isWebAppOrigin: shouldLinkToMyStay } = stay.attributes
|
||||
|
||||
if (!shouldLinkToMyStay) {
|
||||
@@ -24,13 +24,13 @@ export function StayCard({ stay }: StayCardProps) {
|
||||
}
|
||||
|
||||
return (
|
||||
<Link href={bookingUrl} className={styles.link}>
|
||||
<Link className={styles.link} href={bookingUrl} ref={ref}>
|
||||
<CardContent stay={stay} />
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
||||
function CardContent({ stay }: StayCardProps) {
|
||||
function CardContent({ stay }: { stay: StayCardProps["stay"] }) {
|
||||
const lang = useLang()
|
||||
const intl = useIntl()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user