From 51f71383d4ab4b2325dbbcb560d65c5ec95621a9 Mon Sep 17 00:00:00 2001 From: Christian Andolf Date: Wed, 26 Feb 2025 11:23:06 +0100 Subject: [PATCH] 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 --- .../(live)/(public)/hotelreservation/get-booking/page.tsx | 2 +- apps/scandic-web/components/Current/Header/MainMenu/index.tsx | 4 ++-- apps/scandic-web/components/Header/TopMenu/index.tsx | 3 ++- .../HotelReservation/FindMyBooking/findMyBooking.module.css | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/[lang]/(live)/(public)/hotelreservation/get-booking/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/get-booking/page.tsx index 66b865bbc..1ff30e14e 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/get-booking/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/get-booking/page.tsx @@ -2,7 +2,7 @@ import FindMyBooking from "@/components/HotelReservation/FindMyBooking" import styles from "./page.module.css" -export default async function GetBookingPage() { +export default function GetBookingPage() { return (
diff --git a/apps/scandic-web/components/Current/Header/MainMenu/index.tsx b/apps/scandic-web/components/Current/Header/MainMenu/index.tsx index c10b76944..fcff0dcf4 100644 --- a/apps/scandic-web/components/Current/Header/MainMenu/index.tsx +++ b/apps/scandic-web/components/Current/Header/MainMenu/index.tsx @@ -148,12 +148,12 @@ export function MainMenu({
  • - {intl.formatMessage({ id: "Find booking" })} - +
    • diff --git a/apps/scandic-web/components/Header/TopMenu/index.tsx b/apps/scandic-web/components/Header/TopMenu/index.tsx index 4c3db515a..133095db7 100644 --- a/apps/scandic-web/components/Header/TopMenu/index.tsx +++ b/apps/scandic-web/components/Header/TopMenu/index.tsx @@ -20,7 +20,6 @@ export default async function TopMenu() { // cached const intl = await getIntl() // both preloaded - const lang = getLang() const header = await getHeader() const session = await auth() const isLoggedIn = isValidSession(session) @@ -29,6 +28,8 @@ export default async function TopMenu() { return null } + const lang = getLang() + return (
      diff --git a/components/HotelReservation/FindMyBooking/findMyBooking.module.css b/components/HotelReservation/FindMyBooking/findMyBooking.module.css index 8279349f3..5f4d37d3a 100644 --- a/components/HotelReservation/FindMyBooking/findMyBooking.module.css +++ b/components/HotelReservation/FindMyBooking/findMyBooking.module.css @@ -42,7 +42,7 @@ } .buttons > button { - width: 140px; + min-width: 140px; } .footnote {