fix: add my pages nav sidebar for logged in users
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
LoyaltyBlocksTypenameEnum,
|
||||
LoyaltyCardsGridEnum,
|
||||
LoyaltyComponentEnum,
|
||||
LoyaltySidebarDynamicComponentEnum,
|
||||
SidebarTypenameEnum,
|
||||
} from "@/types/components/loyalty/enums"
|
||||
import { Embeds } from "@/types/requests/embeds"
|
||||
@@ -166,8 +167,16 @@ const loyaltyPageJoinLoyaltyContact = z.object({
|
||||
}),
|
||||
})
|
||||
|
||||
const loyaltyPageSidebarDynamicContent = z.object({
|
||||
__typename: z.literal(SidebarTypenameEnum.LoyaltyPageSidebarDynamicContent),
|
||||
dynamic_content: z.object({
|
||||
component: z.nativeEnum(LoyaltySidebarDynamicComponentEnum),
|
||||
}),
|
||||
})
|
||||
|
||||
const loyaltyPageSidebarItem = z.discriminatedUnion("__typename", [
|
||||
loyaltyPageSidebarTextContent,
|
||||
loyaltyPageSidebarDynamicContent,
|
||||
loyaltyPageJoinLoyaltyContact,
|
||||
])
|
||||
|
||||
@@ -226,8 +235,13 @@ export type RteSidebarContent = Omit<SidebarContentRaw, "content"> & {
|
||||
}
|
||||
}
|
||||
}
|
||||
type SideBarDynamicContent = z.infer<typeof loyaltyPageSidebarDynamicContent>
|
||||
|
||||
export type JoinLoyaltyContact = z.infer<typeof loyaltyPageJoinLoyaltyContact>
|
||||
export type Sidebar = JoinLoyaltyContact | RteSidebarContent
|
||||
export type Sidebar =
|
||||
| JoinLoyaltyContact
|
||||
| RteSidebarContent
|
||||
| SideBarDynamicContent
|
||||
type LoyaltyPageDataRaw = z.infer<typeof validateLoyaltyPageSchema>
|
||||
|
||||
export type LoyaltyPage = Omit<LoyaltyPageDataRaw, "blocks" | "sidebar"> & {
|
||||
|
||||
Reference in New Issue
Block a user