Skip to content

Commit

Permalink
Top of structure builder should be a list.
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-matt-hillsdon committed Mar 26, 2024
1 parent 811c7a0 commit cd0103a
Showing 1 changed file with 21 additions and 26 deletions.
47 changes: 21 additions & 26 deletions src/schemas/structure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,31 @@
* SPDX-License-Identifier: MIT
*/
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import {FaCog as ConfigIcon, FaPython} from 'react-icons/fa'
import {FaCog as ConfigIcon} from 'react-icons/fa'
import {StructureBuilder} from 'sanity/structure'

import {singletonPage, sourceDocumentTypeList} from '../common/structureUtils'

const structure = (S: StructureBuilder) =>
S.listItem()
.title('Python editor')
.icon(FaPython)
.child(
S.list()
.title('Python editor')
.items([
S.listItem()
.title('Ideas')
.child(
S.list()
.id('python-ideas')
.items([
S.listItem().title('Ideas').child(sourceDocumentTypeList(S, 'pythonIdea')),
singletonPage(S, 'pythonIdeasConfig', 'Config').icon(ConfigIcon),
]),
),
S.listItem().title('Toolkits').child(sourceDocumentTypeList(S, 'toolkit')),
S.listItem().title('Toolkit topics').child(sourceDocumentTypeList(S, 'toolkitTopic')),
S.listItem()
.title('Toolkit topic entries')
.child(sourceDocumentTypeList(S, 'toolkitTopicEntry')),
S.listItem().title('Python modules').child(sourceDocumentTypeList(S, 'pythonModule')),
]),
)
S.list()
.title('Python Editor')
.items([
S.listItem()
.title('Ideas')
.child(
S.list()
.id('python-ideas')
.items([
S.listItem().title('Ideas').child(sourceDocumentTypeList(S, 'pythonIdea')),
singletonPage(S, 'pythonIdeasConfig', 'Config').icon(ConfigIcon),
]),
),
S.listItem().title('Toolkits').child(sourceDocumentTypeList(S, 'toolkit')),
S.listItem().title('Toolkit topics').child(sourceDocumentTypeList(S, 'toolkitTopic')),
S.listItem()
.title('Toolkit topic entries')
.child(sourceDocumentTypeList(S, 'toolkitTopicEntry')),
S.listItem().title('Python modules').child(sourceDocumentTypeList(S, 'pythonModule')),
])

export default structure

0 comments on commit cd0103a

Please sign in to comment.