From 4139a8ee122aaf669f0022099718ebbca55c1cfc Mon Sep 17 00:00:00 2001 From: Scott Tolksdorf Date: Thu, 5 May 2016 08:36:33 -0400 Subject: [PATCH] UPdating the homebrew editor with new snippet bar --- client/homebrew/editor/editor.jsx | 33 ++++----- client/homebrew/editor/editor.less | 10 +++ client/homebrew/editor/snippets/snippets.js | 71 ++++++++++++++++++- client/homebrew/homePage/homePage.jsx | 53 ++++++++------ client/homebrew/navbar/navbar.jsx | 6 +- .../homebrew/navbar/redditShare.navitem.jsx | 6 +- shared/naturalCrit/nav/nav.less | 2 +- todo.md | 2 +- 8 files changed, 137 insertions(+), 46 deletions(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 6857a215a..60bf7f1d6 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -1,23 +1,22 @@ var React = require('react'); var _ = require('lodash'); var cx = require('classnames'); -var SnippetIcons = require('./snippets/snippets.js'); +var CodeEditor = require('naturalcrit/codeEditor/codeEditor.jsx'); + +var Snippets = require('./snippets/snippets.js'); var Editor = React.createClass({ getDefaultProps: function() { return { - text : "", + value : "", onChange : function(){} }; }, - componentDidMount: function() { - this.refs.textarea.focus(); - }, - handleTextChange : function(e){ - this.props.onChange(e.target.value); + handleTextChange : function(text){ + this.props.onChange(text); }, iconClick : function(snippetFn){ @@ -28,7 +27,7 @@ var Editor = React.createClass({ }, renderTemplateIcons : function(){ - return _.map(SnippetIcons, (t) => { + return _.map(Snippets, (t) => { return
@@ -36,18 +35,20 @@ var Editor = React.createClass({
; }) }, + renderSnippetBar : function(){ + return
+ Snippet bar yo + +
+ }, render : function(){ - var self = this; return(
-
- {this.renderTemplateIcons()} -
-