From 5c19dcf672d6816aa7aef196f48547681e91db46 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Sun, 28 Oct 2018 10:13:09 +0100 Subject: [PATCH 1/3] Add linter to embark-ui --- embark-ui/.eslintrc | 6 ++++++ embark-ui/package.json | 3 --- package.json | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 embark-ui/.eslintrc diff --git a/embark-ui/.eslintrc b/embark-ui/.eslintrc new file mode 100644 index 000000000..19845d602 --- /dev/null +++ b/embark-ui/.eslintrc @@ -0,0 +1,6 @@ +{ + "extends": "react-app", + "rules": { + "react/prop-types": "warn" + } +} \ No newline at end of file diff --git a/embark-ui/package.json b/embark-ui/package.json index fe3d479ef..eec21bdda 100644 --- a/embark-ui/package.json +++ b/embark-ui/package.json @@ -123,8 +123,5 @@ "presets": [ "react-app" ] - }, - "eslintConfig": { - "extends": "react-app" } } diff --git a/package.json b/package.json index 707253925..0913f3f8d 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ }, "main": "./lib/index.js", "scripts": { - "lint": "eslint bin/embark lib/", + "lint": "eslint bin/embark lib/ embark-ui/src", "prepack": "cd embark-ui && npm install && npm run build", "test": "npm-run-all lint test:*", "test:embark": "mocha test/ --no-timeouts --exit", From f1e1c4a14370d1207814a9272777df02a2094048 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Sun, 28 Oct 2018 10:39:40 +0100 Subject: [PATCH 2/3] Color tabs for text editor --- embark-ui/src/components/SearchBar.js | 2 +- embark-ui/src/components/TextEditor.js | 16 +++++++++------- embark-ui/src/index.css | 6 +++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/embark-ui/src/components/SearchBar.js b/embark-ui/src/components/SearchBar.js index 6cb540eee..9167ef2a3 100644 --- a/embark-ui/src/components/SearchBar.js +++ b/embark-ui/src/components/SearchBar.js @@ -44,7 +44,7 @@ class SearchBar extends React.Component { render() { return ( -
+ {!this.props.loading &&
diff --git a/embark-ui/src/components/TextEditor.js b/embark-ui/src/components/TextEditor.js index 9dc01e227..1674906ad 100644 --- a/embark-ui/src/components/TextEditor.js +++ b/embark-ui/src/components/TextEditor.js @@ -4,7 +4,7 @@ import PropTypes from 'prop-types'; import FontAwesomeIcon from 'react-fontawesome'; import classNames from 'classnames'; -import {DARK_THEME} from '../constants'; +import {DARK_THEME, LIGHT_THEME} from '../constants'; import './TextEditor.css'; const SUPPORTED_LANGUAGES = ['css', 'sol', 'html', 'json']; @@ -137,18 +137,20 @@ class TextEditor extends React.Component { renderTabs() { return ( -
    + diff --git a/embark-ui/src/index.css b/embark-ui/src/index.css index f35702e8a..7ac8a40af 100644 --- a/embark-ui/src/index.css +++ b/embark-ui/src/index.css @@ -21,9 +21,6 @@ .relative { position: relative; } -.hidden { - display: none; -} .react-json-view { border-radius: .25rem; @@ -77,3 +74,6 @@ text-decoration: none; } +.bg-black { + background-color: #1C1C1C; +} \ No newline at end of file From d1170d3cef01be1154540cce30f798f851ca927e Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Sun, 28 Oct 2018 11:21:05 +0100 Subject: [PATCH 3/3] Reset content if empty --- embark-ui/src/components/TextEditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/embark-ui/src/components/TextEditor.js b/embark-ui/src/components/TextEditor.js index 9dc01e227..5f5ff8148 100644 --- a/embark-ui/src/components/TextEditor.js +++ b/embark-ui/src/components/TextEditor.js @@ -120,8 +120,8 @@ class TextEditor extends React.Component { } componentDidUpdate(prevProps) { - if (this.props.currentFile.content && this.props.currentFile.content !== prevProps.currentFile.content) { - editor.setValue(this.props.currentFile.content); + if (this.props.currentFile.content !== prevProps.currentFile.content) { + editor.setValue(this.props.currentFile.content || ''); } this.updateMarkers();