added settings
This commit is contained in:
@@ -8,7 +8,7 @@ export const Projects: CollectionConfig = {
|
||||
slug: true,
|
||||
},
|
||||
admin: {
|
||||
defaultColumns: ['title', 'slug', 'updatedAt',],
|
||||
defaultColumns: ['title', 'slug', 'updatedAt', 'order'],
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
@@ -41,6 +41,7 @@ export const Projects: CollectionConfig = {
|
||||
},
|
||||
{
|
||||
name: 'github',
|
||||
label: 'Git Repo',
|
||||
type: 'text'
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,8 +1,22 @@
|
||||
import type { CollectionConfig } from 'payload';
|
||||
import type { GlobalConfig } from 'payload';
|
||||
|
||||
export const Settings: CollectionConfig = {
|
||||
export const Settings: GlobalConfig = {
|
||||
slug: 'settings',
|
||||
fields: [
|
||||
|
||||
{
|
||||
type: 'tabs',
|
||||
tabs: [
|
||||
{
|
||||
label: 'Contact',
|
||||
fields: [
|
||||
{
|
||||
name: 'email',
|
||||
label: 'Contact Email',
|
||||
type: 'email'
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
||||
@@ -92,9 +92,11 @@ export interface Config {
|
||||
};
|
||||
globals: {
|
||||
nav: Nav;
|
||||
settings: Setting;
|
||||
};
|
||||
globalsSelect: {
|
||||
nav: NavSelect<false> | NavSelect<true>;
|
||||
settings: SettingsSelect<false> | SettingsSelect<true>;
|
||||
};
|
||||
locale: null;
|
||||
user: User & {
|
||||
@@ -461,6 +463,16 @@ export interface Nav {
|
||||
updatedAt?: string | null;
|
||||
createdAt?: string | null;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "settings".
|
||||
*/
|
||||
export interface Setting {
|
||||
id: number;
|
||||
email?: string | null;
|
||||
updatedAt?: string | null;
|
||||
createdAt?: string | null;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "nav_select".
|
||||
@@ -476,6 +488,16 @@ export interface NavSelect<T extends boolean = true> {
|
||||
createdAt?: T;
|
||||
globalType?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "settings_select".
|
||||
*/
|
||||
export interface SettingsSelect<T extends boolean = true> {
|
||||
email?: T;
|
||||
updatedAt?: T;
|
||||
createdAt?: T;
|
||||
globalType?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "auth".
|
||||
|
||||
@@ -13,9 +13,8 @@ import { Page } from './collections/Page'
|
||||
import { Projects } from './collections/Projects'
|
||||
import { Categories } from './collections/Categories'
|
||||
import { Nav } from './collections/Nav'
|
||||
import { seoPlugin } from '@payloadcms/plugin-seo'
|
||||
import { GenerateTitle, GenerateURL } from '@payloadcms/plugin-seo/types'
|
||||
import { plugins } from './plugins'
|
||||
import { Settings } from './collections/Settings'
|
||||
|
||||
const filename = fileURLToPath(import.meta.url)
|
||||
const dirname = path.dirname(filename)
|
||||
@@ -36,6 +35,7 @@ export default buildConfig({
|
||||
],
|
||||
globals: [
|
||||
Nav,
|
||||
Settings,
|
||||
],
|
||||
editor: lexicalEditor({
|
||||
features: ({ defaultFeatures, rootFeatures }) => [
|
||||
|
||||
Reference in New Issue
Block a user