feat(SW-1446): add Jump to functionality to Destination Overview Page
This commit is contained in:
@@ -17,10 +17,6 @@ export type DestinationsData = DestinationCountry[]
|
||||
|
||||
export type Cities = DestinationCountry["cities"]
|
||||
|
||||
export type HotelsSectionProps = {
|
||||
destinations: DestinationsData
|
||||
}
|
||||
|
||||
export type DestinationsListProps = {
|
||||
destinations: DestinationsData
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { JumpToData, JumpToProps, LocationMatchResultsState } from "./"
|
||||
|
||||
export type ClientProps = {
|
||||
results: LocationMatchResultsState
|
||||
latest: NonNullable<LocationMatchResultsState>
|
||||
setFilterString: (filter: string | null) => void
|
||||
onAction: JumpToProps<JumpToData>["onAction"]
|
||||
onClearHistory: () => void
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
export type JumpToDataItem = {
|
||||
id: string
|
||||
displayName: string
|
||||
type: "hotels" | "cities"
|
||||
description: string
|
||||
url: string
|
||||
rankingNames: string[]
|
||||
rankingKeywords: string[]
|
||||
}
|
||||
|
||||
export type JumpToData = JumpToDataItem[]
|
||||
|
||||
export type JumpToHistory = {
|
||||
id: JumpToDataItem["id"]
|
||||
type: JumpToDataItem["type"]
|
||||
}[]
|
||||
|
||||
export type JumpToProps<T extends { id: string }[]> = {
|
||||
data: T
|
||||
history: JumpToHistory
|
||||
onAction: (id: T[number]["id"]) => void
|
||||
onClearHistory: () => void
|
||||
}
|
||||
|
||||
export type LocationMatch = {
|
||||
id: string
|
||||
displayName: string
|
||||
type: string
|
||||
description?: string
|
||||
url?: string
|
||||
}
|
||||
|
||||
export type ScoringMatch = LocationMatch & {
|
||||
score: number
|
||||
}
|
||||
|
||||
export type LocationMatchResult = {
|
||||
id: string
|
||||
name: string
|
||||
children: LocationMatch[]
|
||||
}
|
||||
|
||||
export type LocationMatchResults = LocationMatchResult[]
|
||||
export type LocationMatchResultsState = LocationMatchResults | null
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { getJumpToData } from "@/lib/trpc/memoizedRequests"
|
||||
|
||||
export type JumpToResolverProps = {
|
||||
dataPromise: ReturnType<typeof getJumpToData>
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { ClientProps } from "./client"
|
||||
|
||||
export type ResultHistoryProps = Pick<ClientProps, "onClearHistory"> & {
|
||||
results: ClientProps["latest"]
|
||||
}
|
||||
|
||||
export type ResultMatchesProps = Pick<ClientProps, "onAction"> & {
|
||||
results: NonNullable<ClientProps["results"]>
|
||||
}
|
||||
Reference in New Issue
Block a user