summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/transcript/transcript.container.js
blob: d3d3e9f80392e17bd36d8ea3af0227b7f0e84484 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import React, { Component } from 'react'
// import { Link } from 'react-router-dom'
// import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'

import actions from 'app/actions'

import ParagraphList from 'app/views/paragraph/components/paragraph.list'
import { transcriptElementLookup } from './components'

class Transcript extends Component {
  constructor(props){
    super(props)
    this.handleClose = this.handleClose.bind(this)
    this.handleAnnotationClick = this.handleAnnotationClick.bind(this)
    this.handleParagraphDoubleClick = this.handleParagraphDoubleClick.bind(this)
  }
  handleAnnotationClick(e, annotation) {
    console.log(annotation)
  }
  handleParagraphDoubleClick(e, paragraph) {
    return
  }
  handleClose() {
    actions.viewer.hideSection('transcript')
  }
  render() {
    const { viewer } = this.props
    return (
      <div className="transcript">
        <div className='content'>
          <ParagraphList
            paragraphElementLookup={transcriptElementLookup}
            onAnnotationClick={this.handleAnnotationClick}
            onParagraphDoubleClick={this.handleParagraphDoubleClick}
          />
        </div>
        <div
          className='close'
          onClick={this.handleClose}
        />
        <a className='footer' href='#'>
          Download PDF
        </a>
      </div>
    )
  }
}

const mapStateToProps = state => ({
  viewer: state.viewer,
})

const mapDispatchToProps = dispatch => ({
  // uploadActions: bindActionCreators({ ...uploadActions }, dispatch),
})

export default connect(mapStateToProps, mapDispatchToProps)(Transcript)