fix(WEB-115): alter contact block to allow any version of multiple numbers and addresses

This commit is contained in:
Simon Emanuelsson
2024-03-15 07:56:25 +01:00
parent 70f9c22410
commit fd6c49ac7c
5 changed files with 164 additions and 80 deletions

View File

@@ -1,28 +1,75 @@
import type { Edges } from "../utils/edges"
import type { Lang } from "@/types/lang"
import type { Typename } from "../utils/typename"
export enum Section {
ContactBlockSectionsExtraInfo = "ContactBlockSectionsExtraInfo",
ContactBlockSectionsMailingAddress = "ContactBlockSectionsMailingAddress",
ContactBlockSectionsPhone = "ContactBlockSectionsPhone",
ContactBlockSectionsTitle = "ContactBlockSectionsTitle",
ContactBlockSectionsVisitingAddress = "ContactBlockSectionsVisitingAddress",
}
type ExtraInfo = Typename<
{
extra_info: {
text: string
}
},
Section.ContactBlockSectionsExtraInfo
>
type MailingAddress = Typename<
{
mailing_address: {
city: string
country: string
name: string
street: string
zip: string
}
},
Section.ContactBlockSectionsMailingAddress
>
type Phone = Typename<
{
phone: {
number: number
title: string
}
},
Section.ContactBlockSectionsPhone
>
type Title = Typename<
{
title: {
text: string
}
},
Section.ContactBlockSectionsTitle
>
type VisitingAddress = Typename<
{
visiting_address: {
city: string
country: string
street: string
zip: string
}
},
Section.ContactBlockSectionsVisitingAddress
>
type Sections = ExtraInfo | MailingAddress | Phone | Title | VisitingAddress
export type ContactNode = {
mailing_address: {
city: string
country: string
name: string
street: string
zip: string
}
sections: Sections[]
system: {
uid: string
locale: Lang
}
phone: {
number: string
title: string
}
title: string
visiting_address: {
city: string
country: string
street: string
zip: string
uid: string
}
}