clean getCachedGlobal types

This commit is contained in:
pierrecabriere
2025-03-12 09:19:32 -04:00
parent 79bbb0f275
commit 985bd198a1
8 changed files with 18 additions and 21 deletions

12
.vscode/settings.json vendored
View File

@@ -16,6 +16,7 @@
{ "rule": "object-shorthand", "severity": "off", "fixable": true }
],
"typescript.tsdk": "node_modules/typescript/lib",
"deno.enable": false,
// Load .git-blame-ignore-revs file
"gitlens.advanced.blame.customArguments": ["--ignore-revs-file", ".git-blame-ignore-revs"],
"jestrunner.jestCommand": "pnpm exec cross-env NODE_OPTIONS=\"--no-deprecation\" node 'node_modules/jest/bin/jest.js'",
@@ -24,5 +25,14 @@
"runtimeArgs": ["--no-deprecation"]
},
// Essentially disables bun test buttons
"bun.test.filePattern": "bun.test.ts"
"bun.test.filePattern": "bun.test.ts",
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true
},
"hide-files.files": []
}

View File

@@ -2,8 +2,6 @@ import { ModalToggler } from '@faceless-ui/modal'
import Link from 'next/link'
import React from 'react'
import type { MainMenu } from '../../payload-types'
import { getCachedGlobal } from '../../utilities/getGlobals'
import { Gutter } from '../Gutter'
import { MenuIcon } from '../icons/Menu'
@@ -35,7 +33,7 @@ export const HeaderBar: React.FC<HeaderBarProps> = ({ children }) => {
}
export async function Header() {
const header: MainMenu = await getCachedGlobal('main-menu', 1)()
const header = await getCachedGlobal('main-menu', 1)()
const navItems = header?.navItems || []

View File

@@ -2,14 +2,12 @@ import { getCachedGlobal } from '@/utilities/getGlobals'
import Link from 'next/link'
import React from 'react'
import type { Footer } from '@/payload-types'
import { ThemeSelector } from '@/providers/Theme/ThemeSelector'
import { CMSLink } from '@/components/Link'
import { TypedLocale } from 'payload'
export async function Footer({ locale }: { locale: TypedLocale }) {
const footer: Footer = await getCachedGlobal('footer', 1, locale)()
const footer = await getCachedGlobal('footer', 1, locale)()
const navItems = footer?.navItems || []

View File

@@ -2,11 +2,10 @@ import { HeaderClient } from './Component.client'
import { getCachedGlobal } from '@/utilities/getGlobals'
import React from 'react'
import type { Header } from '@/payload-types'
import { TypedLocale } from 'payload'
export async function Header({ locale }: { locale: TypedLocale }) {
const header: Header = await getCachedGlobal('header', 1, locale)()
const header = await getCachedGlobal('header', 1, locale)()
return <HeaderClient header={header} />
}

View File

@@ -2,14 +2,12 @@ import { getCachedGlobal } from '@/utilities/getGlobals'
import Link from 'next/link'
import React from 'react'
import type { Footer } from '@/payload-types'
import { ThemeSelector } from '@/providers/Theme/ThemeSelector'
import { CMSLink } from '@/components/Link'
import { Logo } from '@/components/Logo/Logo'
export async function Footer() {
const footerData: Footer = await getCachedGlobal('footer', 1)()
const footerData = await getCachedGlobal('footer', 1)()
const navItems = footerData?.navItems || []

View File

@@ -2,10 +2,8 @@ import { HeaderClient } from './Component.client'
import { getCachedGlobal } from '@/utilities/getGlobals'
import React from 'react'
import type { Header } from '@/payload-types'
export async function Header() {
const headerData: Header = await getCachedGlobal('header', 1)()
const headerData = await getCachedGlobal('header', 1)()
return <HeaderClient data={headerData} />
}

View File

@@ -2,14 +2,12 @@ import { getCachedGlobal } from '@/utilities/getGlobals'
import Link from 'next/link'
import React from 'react'
import type { Footer } from '@/payload-types'
import { ThemeSelector } from '@/providers/Theme/ThemeSelector'
import { CMSLink } from '@/components/Link'
import { Logo } from '@/components/Logo/Logo'
export async function Footer() {
const footerData: Footer = await getCachedGlobal('footer', 1)()
const footerData = await getCachedGlobal('footer', 1)()
const navItems = footerData?.navItems || []

View File

@@ -2,10 +2,8 @@ import { HeaderClient } from './Component.client'
import { getCachedGlobal } from '@/utilities/getGlobals'
import React from 'react'
import type { Header } from '@/payload-types'
export async function Header() {
const headerData: Header = await getCachedGlobal('header', 1)()
const headerData = await getCachedGlobal('header', 1)()
return <HeaderClient data={headerData} />
}