mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-29 11:12:39 +00:00
Initial functionality of basic tag filtering
This commit is contained in:
@@ -46,7 +46,7 @@ const BrewItem = createClass({
|
||||
},
|
||||
|
||||
updateFilter : function(type, term){
|
||||
console.log(`BrewItem: TYPE: ${type}; TERM: ${term}`);
|
||||
// console.log(`BrewItem: TYPE: ${type}; TERM: ${term}`);
|
||||
this.props.updateListFilter(type, term);
|
||||
},
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ const ListPage = createClass({
|
||||
if(!brews || !brews.length) return <div className='noBrews'>No Brews.</div>;
|
||||
|
||||
return _.map(brews, (brew, idx)=>{
|
||||
return <BrewItem brew={brew} key={idx} reportError={this.props.reportError}/>;
|
||||
return <BrewItem brew={brew} key={idx} reportError={this.props.reportError} updateListFilter={this.updateListFilter}/>;
|
||||
});
|
||||
},
|
||||
|
||||
@@ -129,6 +129,7 @@ const ListPage = createClass({
|
||||
},
|
||||
|
||||
handleFilterTextChange : function(e){
|
||||
// console.log(e);
|
||||
this.setState({
|
||||
filterString : e.target.value,
|
||||
});
|
||||
@@ -136,6 +137,12 @@ const ListPage = createClass({
|
||||
return;
|
||||
},
|
||||
|
||||
updateListFilter : function(type, term){
|
||||
// console.log(`ListPage: TYPE: ${type}; TERM: ${term}`);
|
||||
const e = { target: { value: term } };
|
||||
this.handleFilterTextChange(e);
|
||||
},
|
||||
|
||||
updateUrl : function(filterTerm, sortType, sortDir){
|
||||
const url = new URL(window.location.href);
|
||||
const urlParams = new URLSearchParams(url.search);
|
||||
|
||||
Reference in New Issue
Block a user