remove extra solarized link

main
Mike Fix 6 years ago
parent 0b366d18f7
commit 1451ee2582

@ -1,5 +1,5 @@
import Head from 'next/head' import Head from 'next/head'
import { THEMES } from '../lib/constants' import { THEMES, THEMES_HASH } from '../lib/constants'
import Reset from './style/Reset' import Reset from './style/Reset'
import Font from './style/Font' import Font from './style/Font'
import Typography from './style/Typography' import Typography from './style/Typography'
@ -12,10 +12,10 @@ export const StylesheetLink = ({ theme }) => {
let href let href
if (LOCAL_STYLESHEETS.indexOf(theme) > -1) { if (LOCAL_STYLESHEETS.indexOf(theme) > -1) {
href = `/static/themes/${theme}.css` href = `/static/themes/${theme}.css`
} else if (theme.indexOf('solarized') > -1) {
href = '//cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.2/theme/solarized.min.css'
} else { } else {
href = `//cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.2/theme/${theme}.min.css` const themeDef = THEMES_HASH[theme]
href = `//cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.2/theme/${themeDef &&
(themeDef.link || themeDef.id)}.min.css`
} }
return ( return (
@ -78,14 +78,11 @@ export default function Meta() {
<MetaTags /> <MetaTags />
<StylesheetLink theme="seti" /> <StylesheetLink theme="seti" />
<CodeMirrorLink /> <CodeMirrorLink />
<StylesheetLink theme="seti" />
{LOCAL_STYLESHEETS.map(id => ( {LOCAL_STYLESHEETS.map(id => (
<StylesheetLink key={id} theme={id} /> <StylesheetLink key={id} theme={id} />
))} ))}
{onBrowser {onBrowser
? CDN_STYLESHEETS.map(theme => ( ? CDN_STYLESHEETS.map(theme => <StylesheetLink key={theme.id} theme={theme.id} />)
<StylesheetLink key={theme.id} theme={theme.link || theme.id} />
))
: null} : null}
<Reset /> <Reset />
<Font /> <Font />

@ -90,11 +90,13 @@ export const THEMES = [
}, },
{ {
id: 'solarized dark', id: 'solarized dark',
name: 'Solarized (Dark)' name: 'Solarized (Dark)',
link: 'solarized'
}, },
{ {
id: 'solarized light', id: 'solarized light',
name: 'Solarized (Light)' name: 'Solarized (Light)',
link: 'solarized'
}, },
{ {
id: 'tomorrow-night-bright', id: 'tomorrow-night-bright',

Loading…
Cancel
Save