client/src/components/Note.js
author ymh <ymh.work@gmail.com>
Thu, 22 Jun 2017 12:09:48 +0200
changeset 74 043477fd5c5c
parent 33 238818343253
child 78 49c5ea36d0a4
permissions -rw-r--r--
add api call to save notes. internally use ts for time data for notes and session
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
import React from 'react';
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
import PropTypes from 'prop-types';
74
043477fd5c5c add api call to save notes. internally use ts for time data for notes and session
ymh <ymh.work@gmail.com>
parents: 33
diff changeset
     3
import {formatTimestamp} from '../utils';
1
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
const Note = ({note}) => {
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
  return (
33
238818343253 Stick editor to bottom.
Alexandre Segura <mex.zktk@gmail.com>
parents: 18
diff changeset
     7
    <div id={"note-" + note._id} className="note">
74
043477fd5c5c add api call to save notes. internally use ts for time data for notes and session
ymh <ymh.work@gmail.com>
parents: 33
diff changeset
     8
      <span className="start">{formatTimestamp(note.startedAt)}</span>
043477fd5c5c add api call to save notes. internally use ts for time data for notes and session
ymh <ymh.work@gmail.com>
parents: 33
diff changeset
     9
      <span className="finish">{formatTimestamp(note.finishedAt)}</span>
17
877d8796b86d Store serialized HTML in note.
Alexandre Segura <mex.zktk@gmail.com>
parents: 16
diff changeset
    10
      <div dangerouslySetInnerHTML={{ __html: note.html }} />
1
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
    </div>
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
  );
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
};
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
Note.propTypes = {
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
  note: PropTypes.object.isRequired
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
};
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
export default Note;