Created
December 4, 2022 12:19
-
-
Save devmnj/a4848355f5b1d6dcc695ae8c99e0c6e8 to your computer and use it in GitHub Desktop.
Sanity Preview in a Sanity custom type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
preview:{ | |
select:{ | |
title:'name', | |
imageUrl: 'avatar' | |
},prepare(selection){ | |
const {title,imageUrl} =selection; | |
return{ | |
title:title, | |
media:<img src={imageUrl} alt=''/> | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment