diff --git a/app/components/BookBuilder/Chapter.jsx b/app/components/BookBuilder/Chapter.jsx index 5f95314cc9bc18649729c550ab54565ff21a3946..636c9d578bb43d0ab6b52530f3bb6f2aff17be04 100644 --- a/app/components/BookBuilder/Chapter.jsx +++ b/app/components/BookBuilder/Chapter.jsx @@ -28,8 +28,41 @@ export class Chapter extends React.Component { this.setState({ isUploadInProgress: !this.state.isUploadInProgress }) + + // if (!this.state.isUploadInProgress) this.removeUploadState() } + // getLocalStorageKey () { + // const { chapter } = this.props + // return 'chapter:upload:' + chapter.id + // } + // + // persistUploadState () { + // const key = this.getLocalStorageKey() + // window.localStorage.setItem(key, true) + // } + // + // removeUploadState () { + // const key = this.getLocalStorageKey() + // window.localStorage.removeItem(key) + // } + // + // componentWillMount () { + // const key = this.getLocalStorageKey() + // var entry = window.localStorage.getItem(key) + // if (entry) { + // this.setState({ + // isUploadInProgress: true + // }) + // } + // } + // + // componentWillUnmount () { + // if (this.state.isUploadInProgress) { + // this.persistUploadState() + // } + // } + render () { const { book, @@ -51,6 +84,8 @@ export class Chapter extends React.Component { opacity: isDragging ? 0 : 1 } + // TODO -- refactor these huge class names + // TODO -- make the dot and line component/s return connectDragSource(connectDropTarget( <li className={styles.chapterContainer + ' col-lg-12 bb-chapter ' + (chapter.subCategory === 'chapter' ? styles.isChapter : styles.isPart)} diff --git a/app/components/BookBuilder/Division.jsx b/app/components/BookBuilder/Division.jsx index efd4b54034df659afc0111e30bc1110df7adabff..97238b878460ec4b606817afd5962cc5fb39b380 100644 --- a/app/components/BookBuilder/Division.jsx +++ b/app/components/BookBuilder/Division.jsx @@ -114,9 +114,9 @@ export class Division extends React.Component { <Chapter book={book} chapter={c} - key={c.index} id={c.id} ink={ink} + key={c.index} move={_onMove} no={i} outerContainer={outerContainer}