adding sanity components
This commit is contained in:
66
schemas/objects/feobj/productInfo.ts
Normal file
66
schemas/objects/feobj/productInfo.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
import MyPreviewComponent from '@/components/MyPreviewComponent';
|
||||
import { defineField, defineType } from 'sanity';
|
||||
|
||||
export const productInfo = defineType({
|
||||
name: 'productInfo',
|
||||
title: 'Product Info',
|
||||
type: 'object',
|
||||
fields: [
|
||||
defineField({
|
||||
name: 'title',
|
||||
title: 'Title',
|
||||
type: 'string'
|
||||
}),
|
||||
defineField({
|
||||
name: 'mobileImage',
|
||||
type: 'reference',
|
||||
to: {
|
||||
type: 'media',
|
||||
components: {
|
||||
preview: MyPreviewComponent
|
||||
}
|
||||
},
|
||||
}),
|
||||
defineField({
|
||||
name: 'deskImage',
|
||||
type: 'reference',
|
||||
to: {
|
||||
type: 'media',
|
||||
components: {
|
||||
preview: MyPreviewComponent
|
||||
}
|
||||
},
|
||||
}),
|
||||
defineField({
|
||||
name: 'price',
|
||||
title: 'Price',
|
||||
type: 'object',
|
||||
fields: [
|
||||
defineField({
|
||||
name: 'ogPrice',
|
||||
title: 'Original Price',
|
||||
type: 'number'
|
||||
}),
|
||||
defineField({
|
||||
name: 'newPrice',
|
||||
title: 'New Price',
|
||||
type: 'number'
|
||||
}),
|
||||
]
|
||||
}),
|
||||
defineField({
|
||||
name: 'category',
|
||||
title: 'Category',
|
||||
type: 'string'
|
||||
// I would make this a reference if there was more products
|
||||
}),
|
||||
defineField({
|
||||
name: 'desc',
|
||||
title: 'Description',
|
||||
type: 'text'
|
||||
})
|
||||
],
|
||||
options: {
|
||||
collapsed: true
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user