From 17fb6581d305732e2cf0add7f3444e1aa80aec5c Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 19 Mar 2021 19:10:26 +0100 Subject: split tile handles into individual files. add video subsection loop --- frontend/app/views/page/components/tile.edit.js | 86 ------------------------- 1 file changed, 86 deletions(-) delete mode 100644 frontend/app/views/page/components/tile.edit.js (limited to 'frontend/app/views/page/components/tile.edit.js') diff --git a/frontend/app/views/page/components/tile.edit.js b/frontend/app/views/page/components/tile.edit.js deleted file mode 100644 index cae9f73..0000000 --- a/frontend/app/views/page/components/tile.edit.js +++ /dev/null @@ -1,86 +0,0 @@ -import React, { Component } from 'react' -// import { Link } from 'react-router-dom' -import { bindActionCreators } from 'redux' -import { connect } from 'react-redux' - -// import { history } from 'app/store' -import actions from 'app/actions' -import * as pageActions from '../../page/page.actions' -import * as tileActions from '../../tile/tile.actions' - -import { Loader } from 'app/common' - -import TileForm from '../components/tile.form' - -class TileEdit extends Component { - state = { - tile: null - } - - componentDidMount() { - this.load() - } - - componentDidUpdate(prevProps) { - if (prevProps.page.editor.currentEditTileId !== this.props.page.editor.currentEditTileId) { - this.load() - } - } - - load() { - const { currentEditTileId } = this.props.page.editor - const { tiles } = this.props.page.show.res - if (!tiles) return - const tile = tiles.filter(tile => tile.id === currentEditTileId)[0] - console.log('edit', currentEditTileId) - this.setState({ tile }) - } - - handleSubmit(data) { - actions.tile.update(data) - .then(response => { - // console.log(response) - if (response.status === 'ok') { - this.props.pageActions.updatePageTile(response.res) - } - }) - } - - handleClose() { - this.props.pageActions.hideEditTileForm() - this.props.tileActions.clearTemporaryTile() - } - - render() { - const { tile } = this.state - if (!tile) { - return ( -
- -
- ) - } - return ( - - ) - } -} - -const mapStateToProps = state => ({ - graph: state.graph, - page: state.page, - tile: state.tile, -}) - -const mapDispatchToProps = dispatch => ({ - pageActions: bindActionCreators({ ...pageActions }, dispatch), - tileActions: bindActionCreators({ ...tileActions }, dispatch), -}) - -export default connect(mapStateToProps, mapDispatchToProps)(TileEdit) -- cgit v1.2.3-70-g09d2