move @font-face into function component

main
Mike Fix 6 years ago
parent 754965198d
commit ff26f0f624

@ -400,15 +400,7 @@ class Editor extends React.Component {
</Overlay>
)}
</Dropzone>
<style jsx global>
{`
@font-face {
font-family: ${config.fontUrl ? config.fontFamily : ''};
src: url(${config.fontUrl || ''}) format('woff');
font-display: swap;
}
`}
</style>
<FontFace {...config} />
<style jsx>
{`
.editor {
@ -429,6 +421,20 @@ class Editor extends React.Component {
}
}
function FontFace(config) {
return (
<style jsx global>
{`
@font-face {
font-family: ${config.fontUrl ? config.fontFamily : ''};
src: url(${config.fontUrl || ''}) format('woff');
font-display: swap;
}
`}
</style>
)
}
function isImage(file) {
return file.type.split('/')[0] === 'image'
}

Loading…
Cancel
Save