update meta

main
raboid 6 years ago committed by Michael Fix
parent 5addb18bb7
commit 40ba1e0f9e

@ -68,15 +68,13 @@ export const MetaTags = () => (
* Before supporting <link rel="preload"> verify that it is widely supported in FireFox * Before supporting <link rel="preload"> verify that it is widely supported in FireFox
* with out a flag here: https://caniuse.com/#feat=link-rel-preload * with out a flag here: https://caniuse.com/#feat=link-rel-preload
*/ */
export default function Meta() { export const MetaLinks = () => {
const onBrowser = typeof window !== 'undefined' const onBrowser = typeof window !== 'undefined'
return ( return (
<div className="meta"> <React.Fragment>
<Head> <Head>
<title>Carbon</title>
<link rel="stylesheet" href="/static/react-crop.css" /> <link rel="stylesheet" href="/static/react-crop.css" />
</Head> </Head>
<MetaTags />
<StylesheetLink theme="seti" /> <StylesheetLink theme="seti" />
<CodeMirrorLink /> <CodeMirrorLink />
{LOCAL_STYLESHEETS.map(id => ( {LOCAL_STYLESHEETS.map(id => (
@ -85,16 +83,23 @@ export default function Meta() {
{onBrowser {onBrowser
? CDN_STYLESHEETS.map(theme => <StylesheetLink key={theme.id} theme={theme.id} />) ? CDN_STYLESHEETS.map(theme => <StylesheetLink key={theme.id} theme={theme.id} />)
: null} : null}
</React.Fragment>
)
}
export const Styles = () => (
<React.Fragment>
<Reset /> <Reset />
<Font /> <Font />
<Typography /> <Typography />
<style jsx> </React.Fragment>
{` )
.meta {
display: none; export default function Meta() {
} return (
`} <React.Fragment>
</style> <MetaTags />
</div> <Styles />
</React.Fragment>
) )
} }

@ -5,6 +5,7 @@ import { withRouter } from 'next/router'
// Ours // Ours
import Editor from '../components/Editor' import Editor from '../components/Editor'
import Page from '../components/Page' import Page from '../components/Page'
import { MetaLinks } from '../components/Meta'
import api from '../lib/api' import api from '../lib/api'
import { updateQueryString } from '../lib/routing' import { updateQueryString } from '../lib/routing'
import { saveSettings, clearSettings, omit } from '../lib/util' import { saveSettings, clearSettings, omit } from '../lib/util'
@ -23,6 +24,7 @@ class Index extends React.Component {
render() { render() {
return ( return (
<Page enableHeroText={true}> <Page enableHeroText={true}>
<MetaLinks />
<Editor <Editor
router={this.props.router} router={this.props.router}
onUpdate={this.onEditorUpdate} onUpdate={this.onEditorUpdate}

Loading…
Cancel
Save