Commit 29f91868 authored by Martin Fahl's avatar Martin Fahl
Browse files

makes filter case insensitive

parent e070eb7d
...@@ -7,7 +7,7 @@ const getVisibleItems = (items, filterTerm) => { ...@@ -7,7 +7,7 @@ const getVisibleItems = (items, filterTerm) => {
if (filterTerm === undefined) { if (filterTerm === undefined) {
return items; return items;
} else { } else {
return items.filter(item => item.name.includes(filterTerm)); return items.filter(item => item.name.toLowerCase().includes(filterTerm.toLowerCase()));
} }
} }
......
import React, { Component } from "react"; import React, { Component } from "react";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import { ListGroupItem, Badge, Fa } from "mdbreact"; import { ListGroupItem, Badge, Fa } from "mdbreact";
import { Row, Col } from "mdbreact";
export class Item extends Component { export class Item extends Component {
constructor(props) { constructor(props) {
...@@ -22,20 +23,20 @@ export class Item extends Component { ...@@ -22,20 +23,20 @@ export class Item extends Component {
render() { render() {
return ( return (
<ListGroupItem> <ListGroupItem>
<div className="row"> <Row>
<div className="col"> <Col md="6" xs="4">
{this.props.name} {this.props.name}
</div> </Col>
<div className="col"> <Col md="6" xs="8">
<Badge color="secondary" className="ml-1 mr-1" onClick={this.increment}><Fa icon="plus-square" aria-hidden="true"/></Badge> <Badge color="secondary" className="ml-1 mr-1" onClick={this.increment}><Fa icon="plus-square" aria-hidden="true"/></Badge>
<Badge color="default" className="ml-1 mr-1" pill>{this.state.counter}</Badge> <Badge color="default" className="ml-1 mr-1" pill>{this.state.counter}</Badge>
<Badge color="secondary" className="ml-1 mr-1" onClick={this.decrement}><Fa icon="minus-square" aria-hidden="true"/></Badge> <Badge color="secondary" className="ml-1 mr-1" onClick={this.decrement}><Fa icon="minus-square" aria-hidden="true"/></Badge>
<Badge color="danger" className="ml-1 mr-1"><Fa icon="trash" aria-hidden="true"/></Badge> <Badge color="danger" className="ml-1 mr-1"><Fa icon="trash" aria-hidden="true"/></Badge>
</div> </Col>
</div> </Row>
</ListGroupItem> </ListGroupItem>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment