fix(SW-1273): usage of Link component

move getLang further down the render to reduce CPU cycles

swap to min-width on button to compensate larger strings

remove useless async declaration
This commit is contained in:
Christian Andolf
2025-02-26 11:23:06 +01:00
parent 85cd815968
commit 51f71383d4
4 changed files with 6 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ import FindMyBooking from "@/components/HotelReservation/FindMyBooking"
import styles from "./page.module.css" import styles from "./page.module.css"
export default async function GetBookingPage() { export default function GetBookingPage() {
return ( return (
<main className={styles.main}> <main className={styles.main}>
<div className={styles.form}> <div className={styles.form}>

View File

@@ -148,12 +148,12 @@ export function MainMenu({
<span className={styles.mobileSeparator} /> <span className={styles.mobileSeparator} />
</li> </li>
<li className={styles.mobileLinkRow}> <li className={styles.mobileLinkRow}>
<a <Link
className={styles.mobileLinkButton} className={styles.mobileLinkButton}
href={findMyBooking[lang]} href={findMyBooking[lang]}
> >
{intl.formatMessage({ id: "Find booking" })} {intl.formatMessage({ id: "Find booking" })}
</a> </Link>
</li> </li>
</ul> </ul>
<ul className={styles.mainLinks}> <ul className={styles.mainLinks}>

View File

@@ -20,7 +20,6 @@ export default async function TopMenu() {
// cached // cached
const intl = await getIntl() const intl = await getIntl()
// both preloaded // both preloaded
const lang = getLang()
const header = await getHeader() const header = await getHeader()
const session = await auth() const session = await auth()
const isLoggedIn = isValidSession(session) const isLoggedIn = isValidSession(session)
@@ -29,6 +28,8 @@ export default async function TopMenu() {
return null return null
} }
const lang = getLang()
return ( return (
<div className={styles.topMenu}> <div className={styles.topMenu}>
<div className={styles.content}> <div className={styles.content}>

View File

@@ -42,7 +42,7 @@
} }
.buttons > button { .buttons > button {
width: 140px; min-width: 140px;
} }
.footnote { .footnote {