client/src/components/NotesList.js
author Alexandre Segura <mex.zktk@gmail.com>
Thu, 08 Jun 2017 11:13:41 +0200
changeset 21 284e866f55c7
parent 19 f1b125b95fe9
child 29 4cfeabef7d5e
permissions -rw-r--r--
First version of categories tooltip. - Use react-portal to display hovering menu. - Add custom Mark to store category data.

import React from 'react';

import PropTypes from 'prop-types';
import Immutable from 'immutable';

import { Alert } from 'react-bootstrap';

import Note from './Note';

const NotesList = ({notes}) => {

  if (notes.size === 0) {
    return (
      <Alert bsStyle="warning">No notes yet. Add notes with the textarea below.</Alert>
    );
  }

  return (
    <div>
      {notes.map((note) =>
        <Note note={note} key={note.id} />
      )}
    </div>
  );
};

NotesList.propTypes = {
  notes: PropTypes.instanceOf(Immutable.List).isRequired
};

export default NotesList;