0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-08 18:22:40 +00:00

Full class tables workign with background

This commit is contained in:
Scott
2015-12-28 21:03:20 -05:00
parent ecd17a22c7
commit 29d03c8263
12 changed files with 131 additions and 28 deletions

View File

@@ -2,21 +2,73 @@ var React = require('react');
var _ = require('lodash');
var cx = require('classnames');
var Logo = require('naturalCrit/logo/logo.jsx');
var Statusbar = React.createClass({
getDefaultProps: function() {
return {
editId: null,
shareId : null,
isPending : false,
info : null
};
},
render : function(){
var self = this;
return(
<div className='statusbar'>
Statusbar Ready!
renderInfo : function(){
//render last update?
//number of times viewed?
},
renderNewButton : function(){
if(this.props.editId) return null;
return <a className='newButton' target='_blank' href='/homebrew/new'>
<i className='fa fa-new' />
New
</a>
},
renderLinks : function(){
if(!this.props.editId) return null;
return [
<div className='' key='edit'>
<span>Edit Link</span>
<input type='text' readOnly value={this.props.editId} />
</div>,
<div className='' key='share'>
<a herf={'/share/' + this.props.shareId}>Share Link</a>
<input type='text' readOnly value={this.props.shareId} />
</div>
);
]
},
renderStatus : function(){
if(!this.props.editId) return null;
var text = 'Saved.'
if(this.props.isPending){
text = 'Saving...'
}
return <div className='savingStatus'>
{text}
</div>
},
render : function(){
console.log(this.props);
return <div className='statusbar'>
<Logo />
Statusbar Ready!
<div className='controls'>
{this.renderLinks()}
{this.renderStatus()}
{this.renderNewButton()}
</div>
</div>
}
});

View File

@@ -1,3 +1,12 @@
.statusbar{
font-size : 1.8em;
color : white;
svg{
vertical-align : middle;
height : 1em;
margin-right : 0.2em;
cursor : pointer;
fill : white;
}
}