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

makes filter case insensitive

parent e070eb7d
......@@ -7,7 +7,7 @@ const getVisibleItems = (items, filterTerm) => {
if (filterTerm === undefined) {
return items;
} 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 PropTypes from "prop-types";
import { ListGroupItem, Badge, Fa } from "mdbreact";
import { Row, Col } from "mdbreact";
export class Item extends Component {
constructor(props) {
......@@ -22,20 +23,20 @@ export class Item extends Component {
render() {
return (
<ListGroupItem>
<div className="row">
<Row>
<div className="col">
<Col md="6" xs="4">
{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="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="danger" className="ml-1 mr-1"><Fa icon="trash" aria-hidden="true"/></Badge>
</div>
</Col>
</div>
</Row>
</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