Created
June 2, 2020 09:43
-
-
Save TheEskhaton/b0ea80aa3ff6e496c4879aab5d08c96a to your computer and use it in GitHub Desktop.
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
import React from 'react'; | |
import Gist from 'super-react-gist'; | |
const Preview = ({value : {url}}) => { | |
if(!url) return null; | |
return <div style={{height: "100px", overflowY: 'scroll'}}><Gist url={url} /></div> | |
} | |
export default { | |
name: 'gist', | |
type: 'object', | |
title: 'Gist Embed', | |
fields: [ | |
{ | |
name: 'url', | |
type: 'url', | |
title: 'Gist Url' | |
} | |
], | |
preview: { | |
select: { | |
url: 'url' | |
}, | |
component: Preview | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment