Skip to content

Instantly share code, notes, and snippets.

@TheEskhaton
Created June 2, 2020 09:43
Show Gist options
  • Save TheEskhaton/b0ea80aa3ff6e496c4879aab5d08c96a to your computer and use it in GitHub Desktop.
Save TheEskhaton/b0ea80aa3ff6e496c4879aab5d08c96a to your computer and use it in GitHub Desktop.
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