client/src/components/Note.js
author Alexandre Segura <mex.zktk@gmail.com>
Thu, 22 Jun 2017 12:37:53 +0200
changeset 78 49c5ea36d0a4
parent 74 043477fd5c5c
child 79 772b73e31069
permissions -rw-r--r--
Store margin comment.
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>
78
49c5ea36d0a4 Store margin comment.
Alexandre Segura <mex.zktk@gmail.com>
parents: 74
diff changeset
    10
      <div className="note-content" dangerouslySetInnerHTML={{ __html: note.html }} />
49c5ea36d0a4 Store margin comment.
Alexandre Segura <mex.zktk@gmail.com>
parents: 74
diff changeset
    11
      <div className="note-margin-comment">
49c5ea36d0a4 Store margin comment.
Alexandre Segura <mex.zktk@gmail.com>
parents: 74
diff changeset
    12
        <small className="text-muted">{ note.marginComment }</small>
49c5ea36d0a4 Store margin comment.
Alexandre Segura <mex.zktk@gmail.com>
parents: 74
diff changeset
    13
      </div>
1
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
    </div>
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
  );
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
};
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
Note.propTypes = {
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
  note: PropTypes.object.isRequired
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
};
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
export default Note;