1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 10:16:26 +00:00

addTag search

This commit is contained in:
Rokt33r
2015-10-22 08:30:39 +09:00
parent c507dfa6c4
commit f56df7c16d
10 changed files with 63 additions and 14 deletions

20
lib/components/TagLink.js Normal file
View File

@@ -0,0 +1,20 @@
import React, { PropTypes } from 'react'
import store from '../store'
import { setTagFilter } from '../actions'
export default class TagLink extends React.Component {
handleClick (e) {
store.dispatch(setTagFilter(this.props.tag.name))
}
render () {
return (
<a onClick={e => this.handleClick(e)}>{this.props.tag.name}</a>
)
}
}
TagLink.propTypes = {
tag: PropTypes.shape({
name: PropTypes.string
})
}