client/src/components/NoteInput.js
changeset 143 cfcbf4bc66f1
parent 138 a1fb2ced3049
child 157 5c3af4f10e92
equal deleted inserted replaced
142:56850f5c73f6 143:cfcbf4bc66f1
     1 import React, { Component } from 'react';
     1 import React, { Component } from 'react';
     2 import { Form, FormControl } from 'react-bootstrap';
       
     3 
       
     4 import PropTypes from 'prop-types';
     2 import PropTypes from 'prop-types';
     5 import SlateEditor from './SlateEditor';
     3 import SlateEditor from './SlateEditor';
     6 import { now } from '../utils';
     4 import { now } from '../utils';
     7 
     5 
     8 
     6 
    53     this.setState({ buttonDisabled: text.length === 0 });
    51     this.setState({ buttonDisabled: text.length === 0 });
    54   }
    52   }
    55 
    53 
    56   render() {
    54   render() {
    57     return (
    55     return (
    58       <Form>
    56       <form>
    59         <div className="editor">
    57         <div className="editor">
    60           <div className="editor-left">
    58           <div className="editor-left">
    61             <SlateEditor ref="editor"
    59             <SlateEditor ref="editor"
    62               onChange={this.onEditorChange}
    60               onChange={this.onEditorChange}
    63               onEnterKeyDown={this.onAddNoteClick}
    61               onEnterKeyDown={this.onAddNoteClick}
    66               isChecked={this.props.autoSubmit}
    64               isChecked={this.props.autoSubmit}
    67               isButtonDisabled={this.state.buttonDisabled}
    65               isButtonDisabled={this.state.buttonDisabled}
    68               annotationCategories={ this.props.annotationCategories } />
    66               annotationCategories={ this.props.annotationCategories } />
    69           </div>
    67           </div>
    70           <div className="editor-right">
    68           <div className="editor-right">
    71             <FormControl
    69             <input type="textarea" className="form-control"
    72               name="margin"
    70               name="margin"
    73               componentClass="textarea"
       
    74               placeholder="Enter a margin comment for your note"
    71               placeholder="Enter a margin comment for your note"
    75               inputRef={ ref => { this.marginComment = ref; } }
    72               // inputRef={ ref => { this.marginComment = ref; } }
       
    73               ref={(marginComment) => { this.marginComment = marginComment; }}
    76             />
    74             />
    77           </div>
    75           </div>
    78         </div>
    76         </div>
    79       </Form>
    77       </form>
    80     );
    78     );
    81   }
    79   }
    82 }
    80 }
    83 
    81 
    84 NoteInput.propTypes = {
    82 NoteInput.propTypes = {