From bbeaf01319128e4954d850cf929de31fb3efa99e Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Wed, 1 Aug 2018 19:04:58 +0200 Subject: [PATCH] Created filtering by tag feature --- src/short-urls/SearchBar.js | 48 +++++++++++++++++------- src/short-urls/ShortUrlsList.js | 19 ++++------ src/short-urls/helpers/ShortUrlsRow.js | 24 ++++++++---- src/short-urls/helpers/ShortUrlsRow.scss | 2 +- src/utils/Tag.js | 32 +++++++++------- src/utils/Tag.scss | 14 +++++++ 6 files changed, 92 insertions(+), 47 deletions(-) diff --git a/src/short-urls/SearchBar.js b/src/short-urls/SearchBar.js index 7524214f..693d233d 100644 --- a/src/short-urls/SearchBar.js +++ b/src/short-urls/SearchBar.js @@ -2,6 +2,7 @@ import searchIcon from '@fortawesome/fontawesome-free-solid/faSearch'; import FontAwesomeIcon from '@fortawesome/react-fontawesome'; import React from 'react'; import { connect } from 'react-redux'; +import Tag from '../utils/Tag'; import { listShortUrls } from './reducers/shortUrlsList'; import './SearchBar.scss'; import { pick } from 'ramda'; @@ -14,22 +15,41 @@ export class SearchBar extends React.Component { timer = null; render() { + const { listShortUrls, shortUrlsListParams } = this.props; + const selectedTag = shortUrlsListParams.tags ? shortUrlsListParams.tags[0] : ''; + return ( -
- this.searchTermChanged(e.target.value)} - value={this.state.searchTerm} - /> - -