This commit is contained in:
@ -1,26 +0,0 @@
|
||||
import deepMerge from 'deepmerge'
|
||||
import type { Field } from 'payload/types'
|
||||
import * as HiIcons from 'react-icons/hi2'
|
||||
|
||||
const iconOptions = Object.entries(HiIcons)
|
||||
.filter(([key, value]) => typeof value === 'function')
|
||||
.map(([key]) => ({
|
||||
value: key,
|
||||
label: key.replace(/([a-z])([A-Z])/g, '$1 $2')
|
||||
}))
|
||||
|
||||
type IconField = (overrides?: Partial<Field>) => Field
|
||||
|
||||
const iconField: IconField = (overrides = {}) => {
|
||||
return deepMerge<Field, Partial<Field>>(
|
||||
{
|
||||
type: 'select',
|
||||
name: 'icon',
|
||||
label: 'Icon',
|
||||
options: iconOptions
|
||||
},
|
||||
overrides
|
||||
)
|
||||
}
|
||||
|
||||
export default iconField
|
@ -74,7 +74,7 @@ const TextComponent: FC<TextComponentProps> = ({ children, format }) => {
|
||||
const SerializedLink: React.FC<{
|
||||
node: SerializedLexicalNode
|
||||
locale: string
|
||||
children: JSX.Element | null
|
||||
children: React.JSX.Element | null
|
||||
}> = ({ node, locale, children }) => {
|
||||
const { doc, url, newTab, linkType } = node.fields as any
|
||||
const document = doc?.value
|
||||
@ -164,7 +164,7 @@ const LexicalContent: React.FC<{
|
||||
</li>
|
||||
)
|
||||
case 'heading':
|
||||
const HeadingTag = node.tag as keyof JSX.IntrinsicElements
|
||||
const HeadingTag = node.tag as keyof React.JSX.IntrinsicElements
|
||||
return (
|
||||
<HeadingTag key={ix} {...attributes}>
|
||||
{serializedChildren}
|
||||
|
@ -1,4 +1,4 @@
|
||||
'use server'
|
||||
/* 'use server'
|
||||
|
||||
import { SESSION_STRATEGY } from '@/lib/auth/config'
|
||||
import { COLLECTION_SLUG_SESSIONS } from '@/payload/collections/config'
|
||||
@ -16,3 +16,4 @@ export const revalidateUser = async (user: User, payload: Payload) => {
|
||||
})
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
import configPromise from '@payload-config'
|
||||
import { getPayloadHMR as getPayloadInstance } from '@payloadcms/next/utilities'
|
||||
import { headers as getHeaders } from 'next/headers'
|
||||
import type { User } from '~/payload-types'
|
||||
import type { User } from 'types/payload-types'
|
||||
|
||||
export async function getPayload(): ReturnType<typeof getPayloadInstance> {
|
||||
return getPayloadInstance({ config: await configPromise })
|
||||
|
Reference in New Issue
Block a user