diff -r 49c5ea36d0a4 -r 772b73e31069 client/src/components/Note.js --- a/client/src/components/Note.js Thu Jun 22 12:37:53 2017 +0200 +++ b/client/src/components/Note.js Fri Jun 23 10:16:49 2017 +0200 @@ -1,22 +1,80 @@ -import React from 'react'; +import React, { Component } from 'react'; +import { connect } from 'react-redux'; +import { bindActionCreators } from 'redux'; import PropTypes from 'prop-types'; -import {formatTimestamp} from '../utils'; +import { formatTimestamp } from '../utils'; +import SlateEditor from './SlateEditor'; +import * as notesActions from '../actions/notesActions'; + +class Note extends Component { + + state = { + edit: false + } + + toggleEditMode = () => { + const { edit } = this.state; + this.setState({ edit: !edit }) + } + + onClickDelete = (e) => { + e.preventDefault(); + e.stopPropagation(); + + this.props.notesActions.deleteNote(this.props.note); + } -const Note = ({note}) => { - return ( -