fix: refine url logic based on typename
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
import type { AllRequestResponse } from "../utils/all"
|
||||
import { Edges } from "../utils/edges"
|
||||
import { Typename } from "../utils/typename"
|
||||
|
||||
export enum PageLinkEnum {
|
||||
CodeDefinedPage = "CodeDefinedPage",
|
||||
ContentPage = "ContentPage",
|
||||
}
|
||||
|
||||
export type MenuItem = {
|
||||
uid: string
|
||||
@@ -11,12 +17,27 @@ export type MenuItem = {
|
||||
|
||||
export type SidebarProps = { menuItems: MenuItem[] }
|
||||
|
||||
export type PageLink = {
|
||||
uid: string
|
||||
title: string
|
||||
url: string
|
||||
system: { uid: string }
|
||||
}
|
||||
export type CodeDefinedPageLink = Typename<
|
||||
{
|
||||
uid: string
|
||||
title: string
|
||||
url: string
|
||||
system: { uid: string }
|
||||
},
|
||||
PageLinkEnum.CodeDefinedPage
|
||||
>
|
||||
|
||||
export type ContentPageLink = Typename<
|
||||
{
|
||||
uid: string
|
||||
title: string
|
||||
web: { url: string }
|
||||
system: { uid: string }
|
||||
},
|
||||
PageLinkEnum.ContentPage
|
||||
>
|
||||
|
||||
export type PageLink = CodeDefinedPageLink | ContentPageLink
|
||||
|
||||
export type NavigationItem = {
|
||||
item: {
|
||||
|
||||
Reference in New Issue
Block a user