1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-16 19:21:52 +00:00

add title "tags"

This commit is contained in:
Sosuke Suzuki
2017-09-30 17:27:50 +09:00
parent faede48217
commit 06bd2b2b79

View File

@@ -83,10 +83,22 @@ class SideNav extends React.Component {
</div> </div>
) )
} else { } else {
component = (
<div>
<p>Tags</p>
{this.folderListComponent(data)}
</div>
)
}
return component
}
folderListComponent (data) {
let tagList = data.tagNoteMap.map((tag, key) => { let tagList = data.tagNoteMap.map((tag, key) => {
return key return key
}) })
component = ( return (
tagList.map(tag => { tagList.map(tag => {
return ( return (
<TagListItem name={tag} handleClickTagButton={this.handleClickTagButton.bind(this)} /> <TagListItem name={tag} handleClickTagButton={this.handleClickTagButton.bind(this)} />
@@ -95,11 +107,7 @@ class SideNav extends React.Component {
) )
} }
return component
}
handleClickTagButton (e, name) { handleClickTagButton (e, name) {
console.log(name)
let { router } = this.context let { router } = this.context
router.push(`/tags/${name}`) router.push(`/tags/${name}`)
} }