mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-14 12:52:42 +00:00
Simplified sort arrow, removed duplicate "onClick"
This commit is contained in:
@@ -96,7 +96,7 @@ const BrewItem = createClass({
|
|||||||
render : function(){
|
render : function(){
|
||||||
const brew = this.props.brew;
|
const brew = this.props.brew;
|
||||||
if(Array.isArray(brew.tags)) { // temporary fix until dud tags are cleaned
|
if(Array.isArray(brew.tags)) { // temporary fix until dud tags are cleaned
|
||||||
brew.tags = brew.tags?.filter(tag => tag); //remove tags that are empty strings
|
brew.tags = brew.tags?.filter((tag)=>tag); //remove tags that are empty strings
|
||||||
}
|
}
|
||||||
const dateFormatString = 'YYYY-MM-DD HH:mm:ss';
|
const dateFormatString = 'YYYY-MM-DD HH:mm:ss';
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ const BrewItem = createClass({
|
|||||||
<div className='brewTags' title={`Tags:\n${brew.tags.join('\n')}`}>
|
<div className='brewTags' title={`Tags:\n${brew.tags.join('\n')}`}>
|
||||||
<i className='fas fa-tags'/>
|
<i className='fas fa-tags'/>
|
||||||
{brew.tags.map((tag, idx)=>{
|
{brew.tags.map((tag, idx)=>{
|
||||||
let matches = tag.match(/^(?:([^:]+):)?([^:]+)$/);
|
const matches = tag.match(/^(?:([^:]+):)?([^:]+)$/);
|
||||||
return <span className={matches[1]}>{matches[2]}</span>;
|
return <span className={matches[1]}>{matches[2]}</span>;
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -121,14 +121,8 @@ const ListPage = createClass({
|
|||||||
>
|
>
|
||||||
{`${sortTitle}`}
|
{`${sortTitle}`}
|
||||||
</button>
|
</button>
|
||||||
{this.state.sortType == sortValue ?
|
{this.state.sortType == sortValue &&
|
||||||
<button
|
<i className={`sortDir fas ${this.state.sortDir == 'asc' ? 'fa-sort-up' : 'fa-sort-down'}`}></i>
|
||||||
onClick={this.handleSortDirChange}
|
|
||||||
className='sortDir'
|
|
||||||
>
|
|
||||||
{this.state.sortDir == 'asc' ? <i className='fas fa-sort-up'></i> : <i className='fas fa-sort-down'></i>}
|
|
||||||
</button>
|
|
||||||
: ''
|
|
||||||
}
|
}
|
||||||
</div>;
|
</div>;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -74,12 +74,12 @@
|
|||||||
color: white;
|
color: white;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
&.sortDir {
|
& + .sortDir {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.filter-option {
|
.filter-option {
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
color : #ccc;
|
color : #ccc;
|
||||||
padding : 0;
|
padding : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user