adding sanity components
This commit is contained in:
29
schemas/objects/feobj/scores.ts
Normal file
29
schemas/objects/feobj/scores.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { defineField, defineType } from 'sanity';
|
||||
|
||||
export const scores = defineType({
|
||||
name: 'scores',
|
||||
title: 'Scores',
|
||||
type: 'object',
|
||||
fields: [
|
||||
defineField({
|
||||
name: 'title',
|
||||
title: 'Title',
|
||||
type: 'string'
|
||||
}),
|
||||
defineField({
|
||||
name: 'score',
|
||||
title: 'Score',
|
||||
type: 'number',
|
||||
validation: Rule => Rule.max(100)
|
||||
})
|
||||
],
|
||||
options: {
|
||||
columns: 2
|
||||
},
|
||||
preview: {
|
||||
select: {
|
||||
title: 'score',
|
||||
subtitle: 'title'
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user