fix!: some custom components were not handled properly if they are RSCs (#6315)
**Breaking:** The following, exported components now need the `payload` object as a prop rather than the `config` object: - `RenderCustomComponent` (optional) - `Logo` - `DefaultTemplate` - `DefaultNav`
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import type { AdminViewProps } from 'payload/types'
|
||||
|
||||
import { DefaultTemplate } from '@payloadcms/ui/templates/Default'
|
||||
import LinkImport from 'next/link.js'
|
||||
import { redirect } from 'next/navigation.js'
|
||||
@@ -18,15 +20,15 @@ export const CustomDefaultView: React.FC<AdminViewProps> = ({ initPageResult })
|
||||
const {
|
||||
permissions,
|
||||
req: {
|
||||
i18n,
|
||||
payload,
|
||||
payload: {
|
||||
config,
|
||||
config: {
|
||||
routes: { admin: adminRoute },
|
||||
},
|
||||
},
|
||||
user,
|
||||
},
|
||||
visibleEntities,
|
||||
} = initPageResult
|
||||
|
||||
// If an unauthorized user tries to navigate straight to this page,
|
||||
@@ -36,7 +38,7 @@ export const CustomDefaultView: React.FC<AdminViewProps> = ({ initPageResult })
|
||||
}
|
||||
|
||||
return (
|
||||
<DefaultTemplate config={config} i18n={i18n} permissions={permissions} user={user}>
|
||||
<DefaultTemplate payload={payload} visibleEntities={visibleEntities}>
|
||||
<SetStepNav
|
||||
nav={[
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user