client/src/components/NotesList.js
changeset 12 48ddaa42b810
parent 2 b52921a63e77
child 18 dab2a16500e0
--- a/client/src/components/NotesList.js	Wed May 31 17:28:12 2017 +0200
+++ b/client/src/components/NotesList.js	Wed May 31 17:51:54 2017 +0200
@@ -3,14 +3,21 @@
 import PropTypes from 'prop-types';
 import Immutable from 'immutable';
 
-import { ListGroup, ListGroupItem} from 'react-bootstrap';
+import { ListGroup, ListGroupItem, 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 (
     <ListGroup>
-      {notes.map((note) => 
+      {notes.map((note) =>
         <ListGroupItem key={note.id}><Note note={note} /></ListGroupItem>
       )}
     </ListGroup>
@@ -21,4 +28,4 @@
   notes: PropTypes.instanceOf(Immutable.List).isRequired
 };
 
-export default NotesList;
\ No newline at end of file
+export default NotesList;