1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-15 18:56:22 +00:00

delete note

This commit is contained in:
Dick Choi
2016-07-23 15:28:17 +09:00
parent b2d34ab95d
commit 45b1cd3942
17 changed files with 498 additions and 329 deletions

View File

@@ -4,14 +4,25 @@ import styles from './Detail.styl'
import _ from 'lodash'
import MarkdownNoteDetail from './MarkdownNoteDetail'
import SnippetNoteDetail from './SnippetNoteDetail'
import dataApi from 'browser/main/lib/dataApi'
const electron = require('electron')
import ee from 'browser/main/lib/eventEmitter'
const OSX = global.process.platform === 'darwin'
class Detail extends React.Component {
componentDidUpdate (prevProps, prevState) {
constructor (props) {
super(props)
this.focusHandler = () => {
this.refs.root.focus()
}
}
componentDidMount () {
ee.on('detail:focus', this.focusHandler)
}
componentWillUnmount () {
ee.off('detail:focus', this.focusHandler)
}
render () {
@@ -35,6 +46,7 @@ class Detail extends React.Component {
<div styleName='root'
style={this.props.style}
tabIndex='0'
ref='root'
>
<div styleName='empty'>
<div styleName='empty-message'>{OSX ? 'Command(⌘)' : 'Ctrl(^)'} + N<br/>to create a new post</div>
@@ -48,6 +60,7 @@ class Detail extends React.Component {
<SnippetNoteDetail
note={note}
config={config}
ref='root'
{..._.pick(this.props, [
'dispatch',
'storages',
@@ -63,6 +76,7 @@ class Detail extends React.Component {
<MarkdownNoteDetail
note={note}
config={config}
ref='root'
{..._.pick(this.props, [
'dispatch',
'storages',