1
0
mirror of https://github.com/vercel/commerce.git synced 2025-07-28 12:41:22 +00:00
Files
.github
.vscode
app
components
helpers
lib
sanity
components
desk
blurb-structure.ts
category-structure.ts
home-structure.ts
index.ts
navigation-structure.ts
page-structure.ts
product-structure.ts
search-structure.ts
section-structure.ts
settings-structure.ts
usp-structure.ts
schemas
utils
constants.ts
languages.ts
localizedTypes.ts
queries.tsx
sanity.api.ts
sanity.client.ts
sanity.fetch.ts
sanity.image.ts
sanity.types.ts
shopify
storm
constants.ts
constants.tsx
type-guards.ts
utils.ts
messages
plugins
public
.env.example
.eslintrc.js
.gitignore
.npmrc
.nvmrc
.prettierignore
README.md
components.json
i18n-config.ts
license.md
middleware.ts
next.config.js
package.json
playwright.config.ts
pnpm-lock.yaml
postcss.config.js
prettier.config.js
sanity.config.ts
tailwind.config.js
tsconfig.json
commerce/lib/sanity/desk/category-structure.ts
2023-08-23 23:20:53 +02:00

25 lines
742 B
TypeScript

import { iframeOptions } from '@/sanity.config'
import { EyeOpenIcon, MasterDetailIcon } from '@sanity/icons'
import Iframe from 'sanity-plugin-iframe-pane'
import { ListItemBuilder } from 'sanity/desk'
import defineStructure from '../utils/define-structure'
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(iframeOptions).title('Preview')
])
)
)
)