Introduce "annotation" plugin.
- Wrap mark around text.
- Store selected text in mark data.
- Colorize selected text.
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;