From 079a2dbba4cbf4dc25376e50735343a4e026c836 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Thu, 25 Oct 2018 12:02:13 +0100 Subject: [PATCH] Add light theme to editor --- embark-ui/src/components/FileExplorer.js | 18 +++++++----- embark-ui/src/components/TextEditor.js | 28 +++++++++++++------ .../src/containers/FileExplorerContainer.js | 13 ++++++--- .../src/containers/TextEditorContainer.js | 11 +++++--- 4 files changed, 46 insertions(+), 24 deletions(-) diff --git a/embark-ui/src/components/FileExplorer.js b/embark-ui/src/components/FileExplorer.js index 4bf73d6dc..e93bca9e5 100644 --- a/embark-ui/src/components/FileExplorer.js +++ b/embark-ui/src/components/FileExplorer.js @@ -4,15 +4,18 @@ import React from 'react'; import PropTypes from 'prop-types'; import {Treebeard, decorators} from 'react-treebeard'; import classNames from 'classnames'; +import {DARK_THEME} from '../constants' -const style = { +const isDarkTheme= (theme) => theme === DARK_THEME; + +const style = (theme) => ({ tree: { base: { height: '450px', overflowX: 'auto', listStyle: 'none', - backgroundColor: '#1C1C1C', - color: '#ffffff', + backgroundColor: isDarkTheme(theme) ? '#1C1C1C' : '#FFFFFF', + color: isDarkTheme(theme) ? '#FFFFFF' : '#000000', padding: '10px 0 0 10px', margin: 0, }, @@ -38,7 +41,7 @@ const style = { height: 7, width: 7, arrow: { - fill: '#FFFFFF', + fill: isDarkTheme(theme) ? '#FFFFFF' : '#000000', strokeWidth: 0 } }, @@ -68,7 +71,7 @@ const style = { } } } -}; +}); const Header = ({style, node}) => { @@ -212,7 +215,7 @@ class FileExplorer extends React.Component { data={this.data(this.props.files)} decorators={decorators} onToggle={this.onToggle.bind(this)} - style={style} + style={style(this.props.theme)} />