1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-19 20:51:42 +00:00

modify: change design for note list on finder

This commit is contained in:
sota1235
2016-12-30 18:11:45 +09:00
parent 276471979a
commit 825cd6a93b
3 changed files with 12 additions and 273 deletions

View File

@@ -1,6 +1,6 @@
import React, { PropTypes } from 'react'
import NoteItem from './NoteItem'
import _ from 'lodash'
import NoteItem from 'browser/components/NoteItem'
import moment from 'moment'
class NoteList extends React.Component {
constructor (props) {
@@ -59,16 +59,19 @@ class NoteList extends React.Component {
let notesList = notes
.slice(0, 10 + 10 * this.state.range)
.map((note, _index) => {
let storage = storageMap[note.storage]
let folder = _.find(storage.folders, {key: note.folder})
const isActive = (index === _index)
const key = `${note.storage}-${note.key}`
const dateDisplay = moment(note.updatedAt).fromNow()
return (
<NoteItem
isActive={isActive}
note={note}
key={`${note.storage}-${note.key}`}
storage={storage}
folder={folder}
isActive={index === _index}
onClick={(e) => this.props.handleNoteClick(e, _index)}
dateDisplay={dateDisplay}
key={key}
handleNoteClick={(e) => this.props.handleNoteClick(e, _index)}
handleNoteContextMenu={() => ''}
/>
)
})