feat (v1.0.0): initial refactor and redesign
This commit is contained in:
parent
3058aa1ab4
commit
fe9b50b30e
134 changed files with 17792 additions and 3670 deletions
71
lib/types/navigation.ts
Normal file
71
lib/types/navigation.ts
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
import type { ComponentType, ReactNode } from 'react'
|
||||
|
||||
import type { GitHubRepoSummary } from '@/lib/github'
|
||||
|
||||
export type NavigationIcon = ComponentType<{ className?: string; size?: number } & Record<string, unknown>>
|
||||
|
||||
export type NavigationLink = {
|
||||
label: string
|
||||
href: string
|
||||
icon: NavigationIcon
|
||||
external?: boolean
|
||||
}
|
||||
|
||||
export type NavigationDropdownLinkItem = NavigationLink & {
|
||||
type: 'link'
|
||||
}
|
||||
|
||||
export type NavigationDropdownGroup = {
|
||||
title: string
|
||||
links: NavigationDropdownLinkItem[]
|
||||
}
|
||||
|
||||
export type NavigationDropdownNestedItem = {
|
||||
type: 'nested'
|
||||
label: string
|
||||
icon: NavigationIcon
|
||||
groups: NavigationDropdownGroup[]
|
||||
}
|
||||
|
||||
export type NavigationDropdownItem =
|
||||
| NavigationDropdownLinkItem
|
||||
| NavigationDropdownNestedItem
|
||||
|
||||
export type NavigationDropdownConfig = {
|
||||
items: NavigationDropdownItem[]
|
||||
}
|
||||
|
||||
export type NavigationMenuLinkItem = NavigationLink & {
|
||||
type: 'link'
|
||||
id: string
|
||||
}
|
||||
|
||||
export type NavigationMenuDropdownItem = {
|
||||
type: 'dropdown'
|
||||
id: string
|
||||
label: string
|
||||
href: string
|
||||
icon: NavigationIcon
|
||||
dropdown: NavigationDropdownConfig
|
||||
}
|
||||
|
||||
export type NavigationMenuItem =
|
||||
| NavigationMenuLinkItem
|
||||
| NavigationMenuDropdownItem
|
||||
|
||||
export type FooterMenuRenderContext = {
|
||||
githubUsername: string
|
||||
githubRepos: GitHubRepoSummary[]
|
||||
}
|
||||
|
||||
export type FooterMenuSection =
|
||||
| {
|
||||
type: 'links'
|
||||
title: string
|
||||
links: NavigationLink[]
|
||||
}
|
||||
| {
|
||||
type: 'custom'
|
||||
title: string
|
||||
render: (context: FooterMenuRenderContext) => ReactNode
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue