From f13b394ebd39f6befce57088b49abf95826e99a9 Mon Sep 17 00:00:00 2001 From: Jake Dexheimer Date: Mon, 23 Oct 2017 21:21:58 -0700 Subject: [PATCH] Fix default theme --- lib/constants.js | 1 + pages/editor.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/constants.js b/lib/constants.js index 6833344..9849e8e 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -345,6 +345,7 @@ export const LANGUAGE_MODE_HASH = toHash(LANGUAGES, 'mode') export const LANGUAGE_NAME_HASH = toHash(LANGUAGES, 'short') export const DEFAULT_LANGUAGE = 'auto' +export const DEFAULT_THEME = THEMES_HASH.seti export const COLORS = { BLACK: '#121212', diff --git a/pages/editor.js b/pages/editor.js index 3f51c9b..980348e 100644 --- a/pages/editor.js +++ b/pages/editor.js @@ -22,6 +22,7 @@ import { LANGUAGE_MIME_HASH, LANGUAGE_MODE_HASH, DEFAULT_LANGUAGE, + DEFAULT_THEME, COLORS, DEFAULT_CODE } from '../lib/constants' @@ -55,7 +56,7 @@ class Editor extends React.Component { this.state = Object.assign( { background: 'rgba(171, 184, 195, 1)', - theme: THEMES_HASH.seti.id, + theme: DEFAULT_THEME.id, language: DEFAULT_LANGUAGE, dropShadow: true, windowControls: true, @@ -140,8 +141,8 @@ class Editor extends React.Component {
t.name)} + selected={THEMES_HASH[this.state.theme] || DEFAULT_THEME} + list={THEMES} onChange={theme => this.setState({ theme: theme.id })} />