summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/align/components/player/playButton.component.js
blob: c6a848732c6c34a22693e6e7d3925b36fc2dadb7 (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
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 * as alignActions from '../align.actions'

import { ZOOM_STEPS } from 'app/constants'
import { clamp } from 'app/utils'

const PlayButton = ({ audio }) => {
  return (
    <div
      className={audio.playing ? 'playButton playing' : 'playButton paused'}
      onClick={() => {
        audio.playing ? actions.audio.pause() : actions.audio.play()
      }}
    />
  )
}

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

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

export default connect(mapStateToProps, mapDispatchToProps)(PlayButton)