Merged in feat/footer (pull request #11)

Feat/footer

* chore: correct type

* fix: remove redundant return type

* chore: align code formatting

* chore: format code to avoid diffing noise

* chore: clean up format diffing noise

* chore: move props tying to types folder

* fix: update app_downloads usage and types

* fix: improve footer query and typings

* refactor: add Image.graphql

* fix: correct typings
This commit is contained in:
Arvid Norlin
2024-02-08 14:22:13 +00:00
committed by Simon.Emanuelsson
parent 7926568eae
commit 2bd4e25403
22 changed files with 504 additions and 1723 deletions

View File

@@ -0,0 +1,5 @@
import { NavigationItem } from "@/types/requests/footer"
export type FooterNavigationProps = {
linkGroups: NavigationItem[]
}

View File

@@ -8,12 +8,7 @@ export type Text = {
text: {
content: {
json: RTERootObject
embedded_itemsConnection: Edges<
| ExternalLink
| PageLink
| SysAsset
>
embedded_itemsConnection: Edges<ExternalLink | PageLink | SysAsset>
}
}
}

71
types/requests/footer.ts Normal file
View File

@@ -0,0 +1,71 @@
import type { AllRequestResponse } from "./utils/all"
import type { Edges } from "./utils/edges"
import { Asset } from "./utils/asset"
import { PageLink } from "./utils/pageLink"
type AppDownloadLink = {
title: string
url: string
}
type AppDownload = {
href: string
imageConnection: Edges<Asset>
}
export type InternalLink = {
__typename: "FooterNavigationLinksInternalLink"
internal_link: {
link_text: string
pageConnection: Edges<PageLink>
}
}
export type ExternalLink = {
__typename: "FooterNavigationLinksExternalLink"
external_link: {
link: {
href: string
title: string
}
}
}
export type NavigationItem = {
links: (ExternalLink | InternalLink)[]
title: string
}
type SocialMedium = {
href: string
title: string
}
export type Footer = {
title: string
about: {
title: string
text: string
}
app_downloads: {
title: string
app_store: AppDownload
google_play: AppDownload
}
logoConnection: Edges<Asset>
navigation: NavigationItem[]
social_media: {
title: string
facebook: SocialMedium
instagram: SocialMedium
twitter: SocialMedium
}
trip_advisor: {
title: string
logoConnection: Edges<Asset>
}
}
export type GetFooterData = {
all_footer: AllRequestResponse<Footer>
}