-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathImage.ts
46 lines (45 loc) · 1.01 KB
/
Image.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import type { Block } from 'payload/types';
export const Image: Block = {
slug: 'image',
labels: {
singular: 'Image',
plural: 'Images',
},
fields: [
{
name: 'image',
label: 'Image',
type: 'upload',
relationTo: 'media',
required: true,
},
{
name: 'type',
label: 'Type',
type: 'radio',
defaultValue: 'normal',
options: [
{
label: 'Card',
value: 'card',
},
{
label: 'Feature',
value: 'feature',
},
],
required: true,
admin: {
layout: 'horizontal',
},
},
{
name: 'caption',
label: 'Caption',
type: 'richText',
admin: {
// elements: ['link'],
},
},
],
};