import React, { PropTypes } from 'react' import ReactDOM from 'react-dom' import store from '../store' const electron = require('electron') const ipc = electron.ipcRenderer export default class DeleteArticleModal extends React.Component { constructor (props) { super(props) this.confirmHandler = (e) => this.handleYesButtonClick() } componentDidMount () { ReactDOM.findDOMNode(this.refs.no).focus() ipc.on('modal-confirm', this.confirmHandler) } componentWillUnmount () { ipc.removeListener('modal-confirm', this.confirmHandler) } handleNoButtonClick (e) { this.props.close() } handleYesButtonClick (e) { // store.dispatch(destroyArticle(this.props.articleKey)) this.props.close() } render () { return (