Made ways to get involved a single-document schema

This commit is contained in:
Michael Fatemi 2020-11-29 00:29:23 -05:00
parent d654e46587
commit e4b79e44a3
2 changed files with 39 additions and 16 deletions

View File

@ -2,7 +2,8 @@ import S from '@sanity/desk-tool/structure-builder';
const notSingletonPage = listItem => ![ const notSingletonPage = listItem => ![
"mission", "mission",
"footer" "footer",
"get_involved",
].includes(listItem.getId()) ].includes(listItem.getId())
export default () => export default () =>
@ -17,7 +18,7 @@ export default () =>
.schemaType("mission") .schemaType("mission")
.documentId("mission") .documentId("mission")
), ),
S.listItem() S.listItem()
.title("Footer") .title("Footer")
.child( .child(
S.editor() S.editor()
@ -25,5 +26,13 @@ export default () =>
.schemaType("footer") .schemaType("footer")
.documentId("footer") .documentId("footer")
), ),
S.listItem()
.title("Get Involved")
.child(
S.editor()
.id("get_involved")
.schemaType("get_involved")
.documentId("get_involved")
),
...S.documentTypeListItems().filter(notSingletonPage) ...S.documentTypeListItems().filter(notSingletonPage)
]); ]);

View File

@ -1,22 +1,36 @@
export default { export default {
name: "get_involved", name: "get_involved",
title: "Way to get involved", title: "Get involved",
type: "document", type: "document",
__experimental_actions: [ 'update', 'publish', 'create' ], // removing 'delete'
fields: [ fields: [
{ {
name: "title", name: "ways",
title: "Title", title: "Ways To Get Involved",
type: "string" type: "array",
}, of: [{
{ name: "way",
name: "text", title: "Way To Get Involved",
title: "Text", type: "document",
type: "text" fields: [
}, {
{ name: "title",
name: "priority", title: "Title",
title: "Priority", type: "string"
type: "number" },
{
name: "text",
title: "Text",
type: "text"
},
{
name: "priority",
title: "Priority",
type: "number"
}
]
}]
} }
] ]
} }