0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-05 01:32:47 +00:00

Editor pane looks finished, injecting snippet text is workign and snippet group structure done

This commit is contained in:
Scott Tolksdorf
2016-05-06 13:59:41 -04:00
parent c418ea5b42
commit ad02f99ebe
7 changed files with 192 additions and 115 deletions

View File

@@ -51,6 +51,10 @@ var HomePage = React.createClass({
*/
},
handleSplitMove : function(){
this.refs.editor.update();
},
handleTextChange : function(text){
this.setState({
text : text
@@ -59,43 +63,45 @@ var HomePage = React.createClass({
//localStorage.setItem(KEY, text);
},
renderNavbar : function(){
return <Navbar>
<Nav.section>
<Nav.item>Bad Ass Brew</Nav.item>
</Nav.section>
<Nav.section>
<RedditShare brew={{text : this.state.text}}/>
<Nav.item
newTab={true}
href='https://github.com/stolksdorf/naturalcrit/issues'
color='red'
icon='fa-bug'>
report issue
</Nav.item>
<Nav.item
href='/homebrew/changelog'
color='purple'
icon='fa-file-text-o'>
Changelog
</Nav.item>
<Nav.item
href='/homebrew/new'
color='green'
icon='fa-external-link'>
New Brew
</Nav.item>
</Nav.section>
</Navbar>
},
render : function(){
return(
<div className='homePage page'>
<Navbar>
<Nav.section>
<Nav.item>Bad Ass Brew</Nav.item>
</Nav.section>
<Nav.section>
<RedditShare brew={{text : this.state.text}}/>
<Nav.item
newTab={true}
href='https://github.com/stolksdorf/naturalcrit/issues'
color='red'
icon='fa-bug'>
report issue
</Nav.item>
<Nav.item
href='/homebrew/changelog'
color='purple'
icon='fa-file-text-o'>
Changelog
</Nav.item>
<Nav.item
href='/homebrew/new'
color='green'
icon='fa-external-link'>
New Brew
</Nav.item>
</Nav.section>
</Navbar>
{this.renderNavbar()}
<div className='content'>
<SplitPane>
<Editor value={this.state.text} onChange={this.handleTextChange} />
<SplitPane onDragFinish={this.handleSplitMove} ref='pane'>
<Editor value={this.state.text} onChange={this.handleTextChange} ref='editor'/>
<div>{this.state.text}</div>
</SplitPane>