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:
Niclas Edenvin
2024-08-14 11:00:20 +00:00
parent 35128dbf44
commit e67212bd94
94 changed files with 378 additions and 322 deletions
@@ -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
}
+4 -3
View File
@@ -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
}
+4 -3
View File
@@ -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
}