feat(SW-66, SW-348): search functionality and ui
This commit is contained in:
+15
-12
@@ -1,20 +1,23 @@
|
||||
import { EmbedEnum } from "./utils/embeds"
|
||||
import { PageLink } from "./utils/pageLink"
|
||||
import { Typename } from "./utils/typename"
|
||||
import { PageLink, PageLinkWithOriginalUrl } from "./utils/pageLink"
|
||||
import { TypenameInterface } from "./utils/typename"
|
||||
|
||||
import type { ImageContainer } from "./imageContainer"
|
||||
import type { SysAsset } from "./utils/asset"
|
||||
|
||||
type PageLinkWithOriginalUrl = PageLink & {
|
||||
web: { original_url?: string | null }
|
||||
}
|
||||
type ContentPage = Typename<PageLinkWithOriginalUrl, EmbedEnum.ContentPage>
|
||||
type LoyaltyPage = Typename<PageLinkWithOriginalUrl, EmbedEnum.LoyaltyPage>
|
||||
type AccountPage = Typename<PageLinkWithOriginalUrl, EmbedEnum.AccountPage>
|
||||
interface AccountPage
|
||||
extends TypenameInterface<EmbedEnum.AccountPage>,
|
||||
PageLink {}
|
||||
interface ContentPage
|
||||
extends TypenameInterface<EmbedEnum.ContentPage>,
|
||||
PageLinkWithOriginalUrl {}
|
||||
interface LoyaltyPage
|
||||
extends TypenameInterface<EmbedEnum.LoyaltyPage>,
|
||||
PageLinkWithOriginalUrl {}
|
||||
|
||||
export type Embeds =
|
||||
| SysAsset
|
||||
| ImageContainer
|
||||
| ContentPage
|
||||
| LoyaltyPage
|
||||
| AccountPage
|
||||
| ContentPage
|
||||
| ImageContainer
|
||||
| LoyaltyPage
|
||||
| SysAsset
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import { ImageVaultAssetResponse } from "../components/imageVault"
|
||||
import { EmbedEnum } from "./utils/embeds"
|
||||
import { Typename } from "./utils/typename"
|
||||
|
||||
export type ImageContainer = Typename<
|
||||
{
|
||||
image_left: ImageVaultAssetResponse
|
||||
image_right: ImageVaultAssetResponse
|
||||
system: {
|
||||
uid: string
|
||||
}
|
||||
},
|
||||
EmbedEnum.ImageContainer
|
||||
>
|
||||
import type { ImageVaultAssetResponse } from "../components/imageVault"
|
||||
import type { System } from "./system"
|
||||
import type { TypenameInterface } from "./utils/typename"
|
||||
|
||||
export interface ImageContainer
|
||||
extends TypenameInterface<EmbedEnum.ImageContainer>,
|
||||
System {
|
||||
image_left?: ImageVaultAssetResponse
|
||||
image_right?: ImageVaultAssetResponse
|
||||
}
|
||||
|
||||
@@ -13,7 +13,10 @@ export type LanguageSwitcherData = {
|
||||
}
|
||||
|
||||
type LanguageResult = {
|
||||
items: { web?: { original_url?: string | null }; url: string }[]
|
||||
web?: {
|
||||
original_url?: string | null
|
||||
}
|
||||
url: string
|
||||
}
|
||||
|
||||
export type LanguageSwitcherQueryDataRaw = {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { Lang } from "@/constants/languages"
|
||||
|
||||
export interface System {
|
||||
system: {
|
||||
content_type_uid: string
|
||||
locale: Lang
|
||||
uid: string
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import type { Image } from "@/types/image"
|
||||
import type { EmbedEnum } from "./embeds"
|
||||
import type { Typename } from "./typename"
|
||||
import type { TypenameInterface } from "./typename"
|
||||
|
||||
export type SysAsset = Typename<Image, EmbedEnum.SysAsset>
|
||||
export interface SysAsset
|
||||
extends TypenameInterface<EmbedEnum.SysAsset>,
|
||||
Image {}
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
import type { Lang } from "@/constants/languages"
|
||||
import { z } from "zod"
|
||||
|
||||
import {
|
||||
extendedPageLinkSchema,
|
||||
pageLinkSchema,
|
||||
} from "@/server/routers/contentstack/schemas/pageLinks"
|
||||
|
||||
import type { EmbedEnum } from "./embeds"
|
||||
import type { Typename } from "./typename"
|
||||
import type { TypenameInterface } from "./typename"
|
||||
|
||||
export type PageLink = {
|
||||
system: {
|
||||
uid: string
|
||||
locale: Lang
|
||||
}
|
||||
title: string
|
||||
url: string
|
||||
}
|
||||
export interface PageLink extends z.output<typeof pageLinkSchema> {}
|
||||
|
||||
export type PageLinkType = Typename<PageLink, EmbedEnum.CurrentBlocksPage>
|
||||
export interface PageLinkWithOriginalUrl
|
||||
extends z.output<typeof extendedPageLinkSchema> {}
|
||||
|
||||
export interface PageLinkType
|
||||
extends TypenameInterface<EmbedEnum.CurrentBlocksPage>,
|
||||
PageLink {}
|
||||
|
||||
Reference in New Issue
Block a user