Skip to content

Commit

Permalink
[design-studio] Add author templates
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuslundgard authored and rexxars committed Oct 6, 2020
1 parent 8474f13 commit 508f8cc
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/design-studio/documentInitialValueTemplates/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import T from '@sanity/base/initial-value-template-builder'

export default [
...T.defaults(),

T.template({
id: 'author-developer',
title: 'Developer',
schemaType: 'author',
value: {
role: 'developer'
}
}),

T.template({
id: 'author-designer',
title: 'Designer',
schemaType: 'author',
value: {
role: 'designer'
}
}),

T.template({
id: 'author-manager',
title: 'Manager',
schemaType: 'author',
value: {
role: 'manager'
}
})
]
4 changes: 4 additions & 0 deletions packages/design-studio/sanity.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
{
"name": "part:@sanity/desk-tool/structure",
"path": "./structure"
},
{
"name": "part:@sanity/base/initial-value-templates",
"path": "./documentInitialValueTemplates"
}
]
}
10 changes: 10 additions & 0 deletions packages/design-studio/schemas/author.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ export default {
.min(10)
.max(80)
},
{
type: 'string',
name: 'role',
title: 'Role',
options: {
layout: 'radio',
list: ['developer', 'designer', 'manager'],
direction: 'horizontal' // | 'vertical'
}
},
{
type: 'image',
name: 'avatar',
Expand Down

0 comments on commit 508f8cc

Please sign in to comment.