-
Notifications
You must be signed in to change notification settings - Fork 0
/
deskStructure.js
74 lines (72 loc) · 2.65 KB
/
deskStructure.js
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
import { GoHome } from 'react-icons/go'
import { IoShareSocialSharp, IoDocumentsOutline } from 'react-icons/io5'
import { BiNavigation } from 'react-icons/bi'
import { FaWpforms } from 'react-icons/fa'
const hiddenDocTypes = (listItem) =>
![ 'page', 'homepage', 'navigation', 'socialMediaLinks', 'contactDetails', 'media.tag' ].includes(
listItem.getId()
)
export const deskStructure = (S) =>
S.list()
.title('Content')
.items([
S.listItem()
.title('Home Page')
.icon(GoHome)
.child(
S.editor()
.title('Home Page')
.id('homepage')
.schemaType('homepage')
.documentId('homepageid')
),
S.listItem()
.title('Pages')
.schemaType('page')
.icon(IoDocumentsOutline)
.child(
S.documentList()
.title('Pages')
.filter('_type == "page"')
.child((documentId) =>
S.document()
.documentId(documentId)
.schemaType('page')
.views([
S.view.form(),
])
)
),
S.divider(),
S.listItem()
.title('Social Media Links')
.icon(IoShareSocialSharp)
.child(
S.editor()
.title('Social Media Links')
.id('socialMediaLinks')
.schemaType('socialMediaLinks')
.documentId('socialMediaLinksid')
),
S.listItem()
.title('Navigation')
.icon(BiNavigation)
.child(
S.editor()
.title('Navigation')
.id('navigation')
.schemaType('navigation')
.documentId('navigationid')
),
S.listItem()
.title('Contact Details')
.icon(FaWpforms)
.child(
S.editor()
.title('Contact Details')
.id('contactDetails')
.schemaType('contactDetails')
.documentId('contactDetailsid')
),
...S.documentTypeListItems().filter(hiddenDocTypes),
])