client/src/components/Note.js
author Alexandre Segura <mex.zktk@gmail.com>
Thu, 08 Jun 2017 11:13:41 +0200
changeset 21 284e866f55c7
parent 18 dab2a16500e0
child 33 238818343253
permissions -rw-r--r--
First version of categories tooltip. - Use react-portal to display hovering menu. - Add custom Mark to store category data.
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';
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
const Note = ({note}) => {
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
  return (
18
dab2a16500e0 Add some styles for note timings.
Alexandre Segura <mex.zktk@gmail.com>
parents: 17
diff changeset
     6
    <div id={"note-" + note.id} className="note">
dab2a16500e0 Add some styles for note timings.
Alexandre Segura <mex.zktk@gmail.com>
parents: 17
diff changeset
     7
      <span className="start">{note.startedAt}</span>
dab2a16500e0 Add some styles for note timings.
Alexandre Segura <mex.zktk@gmail.com>
parents: 17
diff changeset
     8
      <span className="finish">{note.finishedAt}</span>
17
877d8796b86d Store serialized HTML in note.
Alexandre Segura <mex.zktk@gmail.com>
parents: 16
diff changeset
     9
      <div dangerouslySetInnerHTML={{ __html: note.html }} />
1
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
    </div>
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
  );
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
Note.propTypes = {
431977d7c9a6 add first react application skeleton
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
  note: PropTypes.object.isRequired
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
export default Note;