mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-13 15:12:43 +00:00
newPage is now working, working on editpage
This commit is contained in:
37
client/homebrew/navbar/staticSave.navitem.jsx
Normal file
37
client/homebrew/navbar/staticSave.navitem.jsx
Normal file
@@ -0,0 +1,37 @@
|
||||
const React = require('react');
|
||||
const _ = require('lodash');
|
||||
const cx = require('classnames');
|
||||
|
||||
const Nav = require('naturalcrit/nav/nav.jsx');
|
||||
const Store = require('homebrewery/brew.store.js');
|
||||
const Actions = require('homebrewery/brew.actions.js');
|
||||
|
||||
const StaticSave = React.createClass({
|
||||
getDefaultProps: function() {
|
||||
return {
|
||||
status : 'ready'
|
||||
};
|
||||
},
|
||||
handleClick : function(){
|
||||
Actions.saveNew();
|
||||
},
|
||||
render : function(){
|
||||
if(this.props.status === 'saving'){
|
||||
return <Nav.item icon='fa-spinner fa-spin' className='staticSave'>
|
||||
save...
|
||||
</Nav.item>
|
||||
}
|
||||
if(this.props.status === 'ready'){
|
||||
return <Nav.item icon='fa-save' className='staticSave' onClick={this.handleClick}>
|
||||
save
|
||||
</Nav.item>
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
module.exports = Store.createSmartComponent(StaticSave, ()=>{
|
||||
return {
|
||||
status : Store.getStatus()
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user