Skip to content
Snippets Groups Projects
IsolatedNoteComponent.js 889 B
Newer Older
import { IsolatedNodeComponent } from 'substance'
import TextPropertyEditor from './TextPropertyEditor'
class IsolatedNoteComponent extends IsolatedNodeComponent {
chris's avatar
chris committed
    // TODO
    // why class sc-entity??
    // rename dataId to calloutId ?? if so, change in provider
    // is there a better way than rendering a text property editor???
    // review ref name
    // do we need a ref ??
    const editing = (this.context.editor.props.disabled) ? 'selection' : 'full'

    let el = $$('div')
      .addClass('sc-entity')
      .attr('data-id', this.props.node.id)
      .append(
        $$(TextPropertyEditor, {
          multiLine: false,
          path: [this.props.node.id, 'content'],
          tagName: 'p'
        }
chris's avatar
chris committed
      )
      .ref('noteContentEditor-' + this.props.node.id))

export default IsolatedNoteComponent