mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-09 02:52:38 +00:00
Remove unnecessary function
This commit is contained in:
@@ -83,7 +83,7 @@ const ListPage = createClass({
|
|||||||
if(!brews || !brews.length) return <div className='noBrews'>No Brews.</div>;
|
if(!brews || !brews.length) return <div className='noBrews'>No Brews.</div>;
|
||||||
|
|
||||||
return _.map(brews, (brew, idx)=>{
|
return _.map(brews, (brew, idx)=>{
|
||||||
return <BrewItem brew={brew} key={idx} reportError={this.props.reportError} updateListFilter={this.updateListFilter}/>;
|
return <BrewItem brew={brew} key={idx} reportError={this.props.reportError} updateListFilter={ (tag)=>{ this.updateUrl(this.state.filterString, this.state.sortType, this.state.sortDir, tag); }}/>;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -137,10 +137,6 @@ const ListPage = createClass({
|
|||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
|
|
||||||
updateListFilter : function(term){
|
|
||||||
this.updateUrl(this.state.filterString, this.state.sortType, this.state.sortDir, term);
|
|
||||||
},
|
|
||||||
|
|
||||||
updateUrl : function(filterTerm, sortType, sortDir, filterTag=''){
|
updateUrl : function(filterTerm, sortType, sortDir, filterTag=''){
|
||||||
const url = new URL(window.location.href);
|
const url = new URL(window.location.href);
|
||||||
const urlParams = new URLSearchParams(url.search);
|
const urlParams = new URLSearchParams(url.search);
|
||||||
@@ -196,7 +192,7 @@ const ListPage = createClass({
|
|||||||
return <div className='tags-container'>
|
return <div className='tags-container'>
|
||||||
{_.map(this.state.filterTags, (tag, idx)=>{
|
{_.map(this.state.filterTags, (tag, idx)=>{
|
||||||
const matches = tag.match(/^(?:([^:]+):)?([^:]+)$/);
|
const matches = tag.match(/^(?:([^:]+):)?([^:]+)$/);
|
||||||
return <span key={idx} className={matches[1]} onClick={()=>{this.updateListFilter(tag);}}>{matches[2]}</span>;
|
return <span key={idx} className={matches[1]} onClick={()=>{ this.updateUrl(this.state.filterString, this.state.sortType, this.state.sortDir, tag); }}>{matches[2]}</span>;
|
||||||
})}
|
})}
|
||||||
</div>;
|
</div>;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user