Updated tags list, allowing to click on a tag to show the list filtered by that tag

This commit is contained in:
Alejandro Celaya
2018-08-18 17:34:49 +02:00
parent 680d80d753
commit 2650027c40
5 changed files with 38 additions and 19 deletions

View File

@@ -44,16 +44,19 @@ export class SearchBar extends React.Component {
<h4 className="search-bar__selected-tag mt-2">
<FontAwesomeIcon icon={tagsIcon} className="search-bar__tags-icon" />
&nbsp;
{selectedTags.map(tag => <Tag
text={tag}
clearable
onClose={() => listShortUrls(
{
...shortUrlsListParams,
tags: selectedTags.filter(selectedTag => selectedTag !== tag)
}
)}
/>)}
{selectedTags.map(tag => (
<Tag
key={tag}
text={tag}
clearable
onClose={() => listShortUrls(
{
...shortUrlsListParams,
tags: selectedTags.filter(selectedTag => selectedTag !== tag)
}
)}
/>
))}
</h4>
)}
</div>