mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-16 12:32: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){
|
updateFilter : function(type, term){
|
||||||
console.log(`BrewItem: TYPE: ${type}; TERM: ${term}`);
|
// console.log(`BrewItem: TYPE: ${type}; TERM: ${term}`);
|
||||||
this.props.updateListFilter(type, term);
|
this.props.updateListFilter(type, term);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,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}/>;
|
return <BrewItem brew={brew} key={idx} reportError={this.props.reportError} updateListFilter={this.updateListFilter}/>;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -129,6 +129,7 @@ const ListPage = createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleFilterTextChange : function(e){
|
handleFilterTextChange : function(e){
|
||||||
|
// console.log(e);
|
||||||
this.setState({
|
this.setState({
|
||||||
filterString : e.target.value,
|
filterString : e.target.value,
|
||||||
});
|
});
|
||||||
@@ -136,6 +137,12 @@ const ListPage = createClass({
|
|||||||
return;
|
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){
|
updateUrl : function(filterTerm, sortType, sortDir){
|
||||||
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user