mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-29 00:22:47 +00:00
removed unnecessary files and refactored layout of dl
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
require('./brewCleanup.less');
|
||||
const React = require('react');
|
||||
const createClass = require('create-react-class');
|
||||
|
||||
const request = require('superagent');
|
||||
|
||||
|
||||
const BrewCleanup = createClass({
|
||||
displayName : 'BrewCleanup',
|
||||
getDefaultProps(){
|
||||
@@ -39,9 +37,9 @@ const BrewCleanup = createClass({
|
||||
if(!this.state.primed) return;
|
||||
|
||||
if(!this.state.count){
|
||||
return <div className='removeBox'>No Matching Brews found.</div>;
|
||||
return <div className='result noBrews'>No Matching Brews found.</div>;
|
||||
}
|
||||
return <div className='removeBox'>
|
||||
return <div className='result'>
|
||||
<button onClick={this.cleanup} className='remove'>
|
||||
{this.state.pending
|
||||
? <i className='fas fa-spin fa-spinner' />
|
||||
@@ -52,7 +50,7 @@ const BrewCleanup = createClass({
|
||||
</div>;
|
||||
},
|
||||
render(){
|
||||
return <div className='BrewCleanup'>
|
||||
return <div className='brewUtil brewCleanup'>
|
||||
<h2> Brew Cleanup </h2>
|
||||
<p>Removes very short brews to tidy up the database</p>
|
||||
|
||||
@@ -65,7 +63,7 @@ const BrewCleanup = createClass({
|
||||
{this.renderPrimed()}
|
||||
|
||||
{this.state.error
|
||||
&& <div className='error'>{this.state.error.toString()}</div>
|
||||
&& <div className='error noBrews'>{this.state.error.toString()}</div>
|
||||
}
|
||||
</div>;
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
.BrewCleanup {
|
||||
.removeBox {
|
||||
margin-top : 20px;
|
||||
button {
|
||||
margin-right : 10px;
|
||||
background-color : @red;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
require('./brewCompress.less');
|
||||
const React = require('react');
|
||||
const createClass = require('create-react-class');
|
||||
|
||||
const request = require('superagent');
|
||||
|
||||
|
||||
const BrewCompress = createClass({
|
||||
displayName : 'BrewCompress',
|
||||
getDefaultProps(){
|
||||
@@ -53,9 +50,9 @@ const BrewCompress = createClass({
|
||||
if(!this.state.primed) return;
|
||||
|
||||
if(!this.state.count){
|
||||
return <div className='removeBox'>No Matching Brews found.</div>;
|
||||
return <div className='result noBrews'>No Matching Brews found.</div>;
|
||||
}
|
||||
return <div className='removeBox'>
|
||||
return <div className='result'>
|
||||
<button onClick={this.cleanup} className='remove'>
|
||||
{this.state.pending
|
||||
? <i className='fas fa-spin fa-spinner' />
|
||||
@@ -69,7 +66,7 @@ const BrewCompress = createClass({
|
||||
</div>;
|
||||
},
|
||||
render(){
|
||||
return <div className='BrewCompress'>
|
||||
return <div className='brewUtil brewCompress'>
|
||||
<h2> Brew Compression </h2>
|
||||
<p>Compresses the text in brews to binary</p>
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
.BrewCompress {
|
||||
.removeBox {
|
||||
margin-top : 20px;
|
||||
button {
|
||||
margin-right : 10px;
|
||||
background-color : @red;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
require('./brewLookup.less');
|
||||
|
||||
const React = require('react');
|
||||
const createClass = require('create-react-class');
|
||||
const cx = require('classnames');
|
||||
@@ -55,7 +53,7 @@ const BrewLookup = createClass({
|
||||
|
||||
renderFoundBrew(){
|
||||
const brew = this.state.foundBrew;
|
||||
return <div className='foundBrew'>
|
||||
return <div className='result'>
|
||||
<dl>
|
||||
<dt>Title</dt>
|
||||
<dd>{brew.title}</dd>
|
||||
@@ -90,7 +88,7 @@ const BrewLookup = createClass({
|
||||
},
|
||||
|
||||
render(){
|
||||
return <div className='brewLookup'>
|
||||
return <div className='brewUtil brewLookup'>
|
||||
<h2>Brew Lookup</h2>
|
||||
<input type='text' value={this.state.query} onChange={this.handleChange} placeholder='edit or share id' />
|
||||
<button onClick={this.lookup}>
|
||||
@@ -106,7 +104,7 @@ const BrewLookup = createClass({
|
||||
|
||||
{this.state.foundBrew
|
||||
? this.renderFoundBrew()
|
||||
: <div className='noBrew'>No brew found.</div>
|
||||
: <div className='result noBrew'>No brew found.</div>
|
||||
}
|
||||
</div>;
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
.brewLookup {
|
||||
.cleanButton {
|
||||
display : inline-block;
|
||||
width : 100%;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
const React = require('react');
|
||||
const createClass = require('create-react-class');
|
||||
|
||||
require('./brewUtils.less');
|
||||
|
||||
const BrewCleanup = require('./brewCleanup/brewCleanup.jsx');
|
||||
const BrewLookup = require('./brewLookup/brewLookup.jsx');
|
||||
|
||||
33
client/admin/brewUtils/brewUtils.less
Normal file
33
client/admin/brewUtils/brewUtils.less
Normal file
@@ -0,0 +1,33 @@
|
||||
.brewUtil {
|
||||
.result {
|
||||
margin-top : 20px;
|
||||
button {
|
||||
margin-right : 10px;
|
||||
background-color : @red;
|
||||
}
|
||||
}
|
||||
.cleanButton {
|
||||
display : inline-block;
|
||||
width : 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.stats {
|
||||
position : relative;
|
||||
|
||||
.pending {
|
||||
position : absolute;
|
||||
top : 0.5em;
|
||||
left : 100px;
|
||||
width : 100%;
|
||||
height : 100%;
|
||||
}
|
||||
|
||||
&:has(.pending) {
|
||||
opacity:0.5;
|
||||
}
|
||||
|
||||
dl {
|
||||
grid-template-columns: 200px 250px;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,8 @@
|
||||
require('./stats.less');
|
||||
const React = require('react');
|
||||
const createClass = require('create-react-class');
|
||||
const cx = require('classnames');
|
||||
|
||||
const request = require('superagent');
|
||||
|
||||
|
||||
const Stats = createClass({
|
||||
displayName : 'Stats',
|
||||
getDefaultProps(){
|
||||
@@ -30,7 +27,7 @@ const Stats = createClass({
|
||||
.finally(()=>this.setState({ fetching: false }));
|
||||
},
|
||||
render(){
|
||||
return <div className='Stats'>
|
||||
return <div className='brewUtil stats'>
|
||||
<h2> Stats </h2>
|
||||
<dl>
|
||||
<dt>Total Brew Count</dt>
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
.Stats {
|
||||
position : relative;
|
||||
|
||||
.pending {
|
||||
position : absolute;
|
||||
top : 0.5em;
|
||||
left : 100px;
|
||||
width : 100%;
|
||||
height : 100%;
|
||||
}
|
||||
|
||||
&:has(.pending) {
|
||||
opacity:0.5;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user