mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
list tags
This commit is contained in:
21
browser/components/TagListItem.js
Normal file
21
browser/components/TagListItem.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/**
|
||||||
|
* @fileoverview Micro component for showing TagList.
|
||||||
|
*/
|
||||||
|
import React, { PropTypes } from 'react'
|
||||||
|
import styles from './TagListItem.styl'
|
||||||
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} name
|
||||||
|
*/
|
||||||
|
|
||||||
|
const TagListItem = (({name}) => {
|
||||||
|
return (
|
||||||
|
<button>
|
||||||
|
{name}
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
export default CSSModules(TagListItem, styles)
|
||||||
|
|
||||||
0
browser/components/TagListItem.styl
Normal file
0
browser/components/TagListItem.styl
Normal file
@@ -454,6 +454,7 @@ class NoteList extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
console.log(this.props)
|
||||||
let { location, notes, config, dispatch } = this.props
|
let { location, notes, config, dispatch } = this.props
|
||||||
let sortFunc = config.sortBy === 'CREATED_AT'
|
let sortFunc = config.sortBy === 'CREATED_AT'
|
||||||
? sortByCreatedAt
|
? sortByCreatedAt
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { openModal } from 'browser/main/lib/modal'
|
|||||||
import PreferencesModal from '../modals/PreferencesModal'
|
import PreferencesModal from '../modals/PreferencesModal'
|
||||||
import ConfigManager from 'browser/main/lib/ConfigManager'
|
import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||||
import StorageItem from './StorageItem'
|
import StorageItem from './StorageItem'
|
||||||
|
import TagListItem from 'browser/components/TagListItem'
|
||||||
import SideNavFilter from 'browser/components/SideNavFilter'
|
import SideNavFilter from 'browser/components/SideNavFilter'
|
||||||
|
|
||||||
class SideNav extends React.Component {
|
class SideNav extends React.Component {
|
||||||
@@ -83,8 +84,15 @@ class SideNav extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
let tagList = data.tagNoteMap.map((tag, key) => {
|
||||||
|
return `# ${key}`
|
||||||
|
})
|
||||||
component = (
|
component = (
|
||||||
<h1>TAG_AREA</h1>
|
tagList.map(tag => {
|
||||||
|
return (
|
||||||
|
<TagListItem name={tag} />
|
||||||
|
)
|
||||||
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user