client/src/components/SlateEditor.js
changeset 138 a1fb2ced3049
parent 103 dc906a578616
child 143 cfcbf4bc66f1
--- a/client/src/components/SlateEditor.js	Thu Aug 03 23:04:33 2017 +0200
+++ b/client/src/components/SlateEditor.js	Fri Aug 04 09:48:09 2017 +0200
@@ -7,6 +7,7 @@
 import AnnotationPlugin from '../AnnotationPlugin'
 import CategoriesTooltip from './CategoriesTooltip'
 import { now } from '../utils';
+import { defaultAnnotationsCategories } from '../constants';
 
 const plugins = [];
 
@@ -46,12 +47,6 @@
   }
 }
 
-const annotationCategories = [
-  { key: 'important', name: 'Important',    color: '#F1C40F' },
-  { key: 'keyword',   name: 'Mot-clé',      color: '#2ECC71' },
-  { key: 'comment',   name: 'Commentaire',  color: '#3498DB', hasComment: true }
-];
-
 /**
  * The rich text example.
  *
@@ -531,7 +526,7 @@
         onClose={this.onPortalClose}
         closeOnOutsideClick={false} closeOnEsc={true}>
         <div className="hovering-menu">
-          <CategoriesTooltip categories={annotationCategories} onCategoryClick={this.onCategoryClick} />
+          <CategoriesTooltip categories={this.props.annotationCategories || defaultAnnotationsCategories} onCategoryClick={this.onCategoryClick} />
         </div>
       </Portal>
     )