From ef78bc6a084f92b4794e987b5832240d85b6479e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 22 Jul 2020 14:05:15 +0200 Subject: refactor app using babel module-resolver --- .../views/paragraph/components/paragraph.form.js | 87 ---------------------- 1 file changed, 87 deletions(-) delete mode 100644 animism-align/frontend/views/paragraph/components/paragraph.form.js (limited to 'animism-align/frontend/views/paragraph/components/paragraph.form.js') diff --git a/animism-align/frontend/views/paragraph/components/paragraph.form.js b/animism-align/frontend/views/paragraph/components/paragraph.form.js deleted file mode 100644 index de3114c..0000000 --- a/animism-align/frontend/views/paragraph/components/paragraph.form.js +++ /dev/null @@ -1,87 +0,0 @@ -import React, { Component } from 'react' -// import { Link } from 'react-router-dom' -import { bindActionCreators } from 'redux' -import { connect } from 'react-redux' - -import actions from '../../../actions' - -import { clamp, timestamp, capitalize } from '../../../util' -import { Select } from '../../../common' - -const PARAGRAPH_TYPES = [ - 'paragraph', 'blockquote', 'hidden', -].map(name => ({ name, label: capitalize(name.replace('_', ' ')) })) - -class ParagraphForm extends Component { - constructor(props){ - super(props) - this.handleChange = this.handleChange.bind(this) - this.handleSelect = this.handleSelect.bind(this) - this.handleSubmit = this.handleSubmit.bind(this) - } - componentDidMount() { - if (this.textareaRef && this.textareaRef.current) { - this.textareaRef.current.focus() - } - } - handleChange(e) { - const { name, value } = e.target - this.handleSelect(name, value) - } - handleSelect(name, value) { - const { onUpdate, paragraph } = this.props - onUpdate({ - ...paragraph, - [name]: value, - }) - } - handleSubmit() { - const { paragraph, onClose } = this.props - actions.paragraph.update(paragraph) - .then(response => { - console.log(response) - onClose() - }) - } - render() { - const { paragraph, y } = this.props - return ( -
- {this.renderButtons()} -
- ) - } - renderButtons() { - const { paragraph } = this.props - return ( -
-
-