diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-03-08 22:11:55 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-03-08 22:11:55 +0100 |
| commit | d2cb17038b8537a609be06be2ed7013dbe27117e (patch) | |
| tree | 028ceac9edddafc03ce80c49d5a05981bec3fcbe /animism-align/frontend/app/views/media/components/media.formFile.js | |
| parent | b5ceb782f40fc1e402d1e58bc1ced2e4038fd787 (diff) | |
beginning the BIG refactor. moving editor stuff into per-episode hierarchy
Diffstat (limited to 'animism-align/frontend/app/views/media/components/media.formFile.js')
| -rw-r--r-- | animism-align/frontend/app/views/media/components/media.formFile.js | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/animism-align/frontend/app/views/media/components/media.formFile.js b/animism-align/frontend/app/views/media/components/media.formFile.js deleted file mode 100644 index d3b1ae8..0000000 --- a/animism-align/frontend/app/views/media/components/media.formFile.js +++ /dev/null @@ -1,67 +0,0 @@ -import React, { Component } from 'react' -import { Link } from 'react-router-dom' - -import { session } from 'app/session' -import actions from 'app/actions' -import { capitalize } from 'app/utils' - -import { TextInput, LabelDescription, Select, TextArea, Checkbox, SubmitButton, Loader, FileInputField } from 'app/common' - -export default class MediaFileForm extends Component { - state = { - img: null, - } - - constructor(props) { - super(props) - this.handleSelect = this.handleSelect.bind(this) - this.handleChange = this.handleChange.bind(this) - this.handleSettingsChange = this.handleSettingsChange.bind(this) - this.handleUpload = this.handleUpload.bind(this) - } - - handleChange(e) { - const { name, value } = e.target - this.handleSelect(name, value) - } - - handleSelect(name, value) { - this.props.onSelect(name, value) - } - - handleSettingsChange(name, value) { - this.props.onSettingsChange(name, value) - } - - handleUpload(file) { - console.log('uploading file') - const uploadData = { - image: file, - tag: "file", - username: 'animism', - } - // uploadData['__image_filename'] = file.filename - return actions.upload.upload(uploadData).then(data => { - this.handleSettingsChange("file", data.res) - }) - } - - render() { - const { data } = this.props - console.log(data.settings) - return ( - <div className='fileForm'> - <FileInputField - title="Upload file" - mime="*/*" - onChange={this.handleUpload} - /> - {data.settings.file && - <LabelDescription> - {data.settings.file.url} - </LabelDescription> - } - </div> - ) - } -} |
