Skip to content

Commit

Permalink
[test-studio] Define a media preview to array of predefined colors
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed Jan 9, 2018
1 parent c90674e commit d32c54e
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion packages/test-studio/schemas/arrays.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react'
export default {
name: 'arraysTest',
type: 'document',
Expand Down Expand Up @@ -58,7 +59,26 @@ export default {
name: 'name',
type: 'string',
}
]
],
preview: {
select: {
title: 'title',
name: 'name'
},
prepare({title, name}) {
return {
title: title,
media: () => (
<div
style={{
backgroundColor: name,
position: 'absolute', height: '100%', width: '100%', top: '0', left: '0'
}}
/>
)
}
}
}
}
],
options: {
Expand Down

0 comments on commit d32c54e

Please sign in to comment.