36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
import S from '@sanity/desk-tool/structure-builder'
|
|
import MdSettings from 'react-icons/lib/md/settings'
|
|
|
|
const hiddenDocTypes = listItem =>
|
|
!['category', 'person', 'project', 'siteSettings'].includes(listItem.getId())
|
|
|
|
export default () =>
|
|
S.list()
|
|
.title('Content')
|
|
.items([
|
|
S.listItem()
|
|
.title('Settings')
|
|
.child(
|
|
S.editor()
|
|
.id('siteSettings')
|
|
.schemaType('siteSettings')
|
|
.documentId('siteSettings')
|
|
)
|
|
.icon(MdSettings),
|
|
S.listItem()
|
|
.title('Projects')
|
|
.schemaType('project')
|
|
.child(S.documentTypeList('project').title('Projects')),
|
|
S.listItem()
|
|
.title('People')
|
|
.schemaType('person')
|
|
.child(S.documentTypeList('person').title('People')),
|
|
S.listItem()
|
|
.title('Categories')
|
|
.schemaType('category')
|
|
.child(S.documentTypeList('category').title('Categories')),
|
|
// This returns an array of all the document types
|
|
// defined in schema.js. We filter out those that we have
|
|
// defined the structure above
|
|
...S.documentTypeListItems().filter(hiddenDocTypes)
|
|
])
|