feat(SW-1273): find my booking page with rudimentary validation and redirect
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { findMyBooking } from "@/constants/myBooking"
|
||||
import { getHeader } from "@/lib/trpc/memoizedRequests"
|
||||
|
||||
import { auth } from "@/auth"
|
||||
@@ -5,6 +6,7 @@ import LanguageSwitcher from "@/components/LanguageSwitcher"
|
||||
import SkeletonShimmer from "@/components/SkeletonShimmer"
|
||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||
import { getIntl } from "@/i18n"
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
import { isValidSession } from "@/utils/session"
|
||||
|
||||
import HeaderLink from "../HeaderLink"
|
||||
@@ -18,6 +20,7 @@ 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)
|
||||
@@ -34,7 +37,7 @@ export default async function TopMenu() {
|
||||
<LanguageSwitcher type="desktopHeader" />
|
||||
|
||||
<Caption type="regular" color="textMediumContrast" asChild>
|
||||
<HeaderLink href="#" iconName={IconName.Search}>
|
||||
<HeaderLink href={findMyBooking[lang]} iconName={IconName.Search}>
|
||||
{intl.formatMessage({ id: "Find booking" })}
|
||||
</HeaderLink>
|
||||
</Caption>
|
||||
|
||||
Reference in New Issue
Block a user