mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
handling tagButton click
This commit is contained in:
@@ -7,11 +7,12 @@ import CSSModules from 'browser/lib/CSSModules'
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name
|
* @param {string} name
|
||||||
|
* @param (Function) handleClickTagButton
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const TagListItem = (({name}) => {
|
const TagListItem = (({name, handleClickTagButton}) => {
|
||||||
return (
|
return (
|
||||||
<button>
|
<button onClick={handleClickTagButton}>
|
||||||
{name}
|
{name}
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class SideNav extends React.Component {
|
|||||||
component = (
|
component = (
|
||||||
tagList.map(tag => {
|
tagList.map(tag => {
|
||||||
return (
|
return (
|
||||||
<TagListItem name={tag} />
|
<TagListItem name={tag} handleClickTagButton={(e) => this.handleClickTagButton(e)} />
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@@ -99,6 +99,10 @@ class SideNav extends React.Component {
|
|||||||
return component
|
return component
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleClickTagButton (e) {
|
||||||
|
console.log('TAGBUTTON!!!')
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
let { data, location, config, dispatch } = this.props
|
let { data, location, config, dispatch } = this.props
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user