mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-13 06:32:39 +00:00
Creating a brand new admin page
This commit is contained in:
45
client/admin/brewLookup/brewLookup.jsx
Normal file
45
client/admin/brewLookup/brewLookup.jsx
Normal file
@@ -0,0 +1,45 @@
|
||||
const React = require('react');
|
||||
const _ = require('lodash');
|
||||
const cx = require('classnames');
|
||||
|
||||
const request = require('superagent');
|
||||
|
||||
const BrewLookup = React.createClass({
|
||||
getDefaultProps: function() {
|
||||
return {
|
||||
adminKey : '',
|
||||
};
|
||||
},
|
||||
getInitialState: function() {
|
||||
return {
|
||||
query:'',
|
||||
resultBrew : null
|
||||
};
|
||||
},
|
||||
|
||||
handleChange : function(e){
|
||||
this.setState({
|
||||
query : e.target.value
|
||||
})
|
||||
},
|
||||
lookup : function(){
|
||||
|
||||
|
||||
},
|
||||
|
||||
renderFoundBrew : function(){
|
||||
if(!this.state.resultBrew) return null;
|
||||
},
|
||||
|
||||
render: function(){
|
||||
return <div className='brewLookup'>
|
||||
<h1>Brew Lookup</h1>
|
||||
<input type='text' value={this.state.query} onChange={this.handleChange} placeholder='edit or share id...' />
|
||||
<button onClick={this.lookup}><i className='fa fa-search'/></button>
|
||||
|
||||
{this.renderFoundBrew()}
|
||||
</div>
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = BrewLookup;
|
||||
8
client/admin/brewLookup/brewLookup.less
Normal file
8
client/admin/brewLookup/brewLookup.less
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
.brewLookup{
|
||||
height : 200px;
|
||||
input{
|
||||
height : 33px;
|
||||
padding : 0px 10px;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user