Merged in feature/refactor-lang (pull request #387)
feat: SW-238 Avoid prop drilling of lang Approved-by: Michael Zetterberg
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { Lang } from "@/constants/languages"
|
||||
|
||||
import type { Image } from "@/types/image"
|
||||
import type {
|
||||
CurrentHeaderLink,
|
||||
@@ -17,5 +15,4 @@ export type MainMenuProps = {
|
||||
myPagesMobileDropdown: React.ReactNode | null
|
||||
bookingHref: string
|
||||
user: Pick<User, "firstName" | "lastName"> | null
|
||||
lang: Lang
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { Lang } from "@/constants/languages"
|
||||
|
||||
import type { TopMenuHeaderLink } from "@/types/requests/currentHeader"
|
||||
|
||||
export type TopMenuProps = {
|
||||
@@ -7,5 +5,4 @@ export type TopMenuProps = {
|
||||
homeHref: string
|
||||
links: TopMenuHeaderLink[]
|
||||
languageSwitcher: React.ReactNode | null
|
||||
lang: Lang
|
||||
}
|
||||
|
||||
@@ -8,6 +8,5 @@ export type LanguageSwitcherLink = {
|
||||
}
|
||||
|
||||
export type LanguageSwitcherProps = {
|
||||
currentLanguage: Lang
|
||||
urls: LanguageSwitcherData
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@ import {
|
||||
|
||||
import { LangParams } from "@/types/params"
|
||||
|
||||
export type SidebarProps = LangParams & {
|
||||
export type SidebarProps = {
|
||||
blocks: Sidebar[]
|
||||
}
|
||||
|
||||
export type JoinLoyaltyContactProps = LangParams & {
|
||||
export type JoinLoyaltyContactProps = {
|
||||
block: JoinLoyaltyContact["join_loyalty_contact"]
|
||||
}
|
||||
|
||||
|
||||
@@ -9,18 +9,15 @@ export type AccountPageContentProps = {
|
||||
title: string | null
|
||||
subtitle: string | null
|
||||
link?: { href: string; text: string }
|
||||
lang: Lang
|
||||
}
|
||||
}
|
||||
|
||||
export type AccountPageComponentProps = {
|
||||
lang: Lang
|
||||
title: string | null
|
||||
subtitle: string | null
|
||||
link?: { href: string; text: string }
|
||||
}
|
||||
|
||||
export type ContentProps = {
|
||||
lang: Lang
|
||||
content: AccountPageContentItem[]
|
||||
}
|
||||
|
||||
@@ -24,12 +24,10 @@ export type EarnAndBurnProps = {
|
||||
}
|
||||
|
||||
export interface TableProps {
|
||||
lang: Lang
|
||||
transactions: Transactions
|
||||
}
|
||||
|
||||
export interface RowProps {
|
||||
lang: Lang
|
||||
transaction: Transaction
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,11 @@ export type PreviousStaysResponse = Awaited<
|
||||
>
|
||||
export type PreviousStaysNonNullResponseObject =
|
||||
NonNullable<PreviousStaysResponse>
|
||||
export type PreviousStays = NonNullable<PreviousStaysNonNullResponseObject>["data"]
|
||||
export type PreviousStay = NonNullable<PreviousStaysNonNullResponseObject>["data"][number]
|
||||
export type PreviousStays =
|
||||
NonNullable<PreviousStaysNonNullResponseObject>["data"]
|
||||
export type PreviousStay =
|
||||
NonNullable<PreviousStaysNonNullResponseObject>["data"][number]
|
||||
|
||||
export interface PreviousStaysClientProps {
|
||||
lang: Lang
|
||||
initialPreviousStays: PreviousStaysNonNullResponseObject
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import type { Lang } from "@/constants/languages"
|
||||
import type { Stay } from "@/server/routers/user/output"
|
||||
|
||||
export type StayCardProps = {
|
||||
lang: Lang
|
||||
stay: Stay
|
||||
}
|
||||
|
||||
@@ -6,10 +6,11 @@ export type UpcomingStaysResponse = Awaited<
|
||||
>
|
||||
export type UpcomingStaysNonNullResponseObject =
|
||||
NonNullable<UpcomingStaysResponse>
|
||||
export type UpcomingStays = NonNullable<UpcomingStaysNonNullResponseObject>["data"]
|
||||
export type UpcomingStay = NonNullable<UpcomingStaysNonNullResponseObject>["data"][number]
|
||||
export type UpcomingStays =
|
||||
NonNullable<UpcomingStaysNonNullResponseObject>["data"]
|
||||
export type UpcomingStay =
|
||||
NonNullable<UpcomingStaysNonNullResponseObject>["data"][number]
|
||||
|
||||
export interface UpcomingStaysClientProps {
|
||||
lang: Lang
|
||||
initialUpcomingStays: UpcomingStaysNonNullResponseObject
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user