-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStatsBlock.ts
More file actions
96 lines (95 loc) · 2.79 KB
/
Copy pathStatsBlock.ts
File metadata and controls
96 lines (95 loc) · 2.79 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import type { Block } from "payload"
export const StatsBlock: Block = {
slug: "stats",
labels: {
singular: "Stats",
plural: "Stats Blocks",
},
fields: [
{
type: "collapsible",
label: "Section",
fields: [
{
name: "sectionHeading",
label: "Section Heading",
type: "text",
required: false,
localized: true,
},
{
name: "sectionLayout",
label: "Section Layout",
type: "select",
required: true,
defaultValue: "center",
options: [
{ label: "Center", value: "center" },
{ label: "Left", value: "left" },
],
},
{
name: "sectionDescription",
label: "Section Description",
type: "textarea",
required: false,
localized: true,
},
{
name: "sectionLinkButton",
label: "Section Link Button",
type: "group",
fields: [
{
name: "label",
type: "text",
required: false,
localized: true,
},
{
name: "url",
type: "text",
required: false,
},
],
},
],
},
{
name: "items",
type: "array",
required: true,
minRows: 1,
maxRows: 3,
labels: {
singular: "Stat",
plural: "Stats",
},
fields: [
{
name: "number",
type: "number",
required: true,
},
{
name: "description",
type: "text",
required: true,
localized: true,
},
{
name: "enableNumberFlow",
label: "Animate number",
type: "checkbox",
defaultValue: true,
},
{
name: "suffix",
label: "Suffix",
type: "text",
localized: true,
},
],
},
],
}