Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 10th, 2020 131 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export default class App extends PureComponent {
  2.   // задаём стейт
  3.   state = {
  4.     filters: [],
  5.   };
  6.  
  7.   filterItems = ( event ) => {
  8.     const checkboxes = [...event.currentTarget.closest(".filter").getElementsByTagName("input")]
  9.     const filters = [];
  10.     checkboxes.map(checkbox => {
  11.       if (checkbox.checked) {
  12.         filters.push(checkbox.name);
  13.       }
  14.     });
  15.     this.setState({ filters });
  16.  
  17.     const result = json.filter(element => filters.every(key => element[key]));
  18.     return result
  19.   }
  20.  
  21.   render() {
  22.     return (
  23.       <div>
  24.         <Filter filterItems={this.filterItems} />
  25.         {
  26.           this.state.filters.length
  27.             ? <Filtered elem={this.filterItems} />
  28.             : <Item />
  29.         }
  30.       </div>
  31.     )
  32.   }
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top