mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Make sure studio is running for build
This commit is contained in:
33
lib/sanity/desk/category-structure.ts
Normal file
33
lib/sanity/desk/category-structure.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import {ListItemBuilder} from 'sanity/desk'
|
||||
import defineStructure from '../utils/define-structure'
|
||||
import Iframe from 'sanity-plugin-iframe-pane'
|
||||
import {SanityDocument} from 'sanity'
|
||||
import {EyeOpenIcon, MasterDetailIcon} from '@sanity/icons'
|
||||
import getPreviewUrl from '../utils/get-preview-url'
|
||||
|
||||
export default defineStructure<ListItemBuilder>((S) =>
|
||||
S.listItem()
|
||||
.title('Categories')
|
||||
.schemaType('category')
|
||||
.child (
|
||||
S.documentTypeList('category')
|
||||
.child (id =>
|
||||
S.document()
|
||||
.schemaType("category")
|
||||
.id(id)
|
||||
.views([
|
||||
S.view
|
||||
.form()
|
||||
.icon(MasterDetailIcon),
|
||||
S.view
|
||||
.component(Iframe)
|
||||
.icon(EyeOpenIcon)
|
||||
.options({
|
||||
url: (doc: SanityDocument) => getPreviewUrl(doc),
|
||||
})
|
||||
.title('Preview')
|
||||
])
|
||||
)
|
||||
|
||||
)
|
||||
)
|
Reference in New Issue
Block a user