summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/align/components/player/playButton.component.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-12-02 15:00:48 +0100
committerJules Laplace <julescarbon@gmail.com>2020-12-02 15:00:48 +0100
commitfa287a8b341926fa3866d7dee31b4f4090a5c98f (patch)
tree62a72177acaf569a444e4d06a09ed8b705647920 /animism-align/frontend/app/views/align/components/player/playButton.component.js
parent441b9efe7a76e801d5d079a70dcb4aeb1a132bb9 (diff)
starting full video modal
Diffstat (limited to 'animism-align/frontend/app/views/align/components/player/playButton.component.js')
-rw-r--r--animism-align/frontend/app/views/align/components/player/playButton.component.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/animism-align/frontend/app/views/align/components/player/playButton.component.js b/animism-align/frontend/app/views/align/components/player/playButton.component.js
index 03603ce..f411941 100644
--- a/animism-align/frontend/app/views/align/components/player/playButton.component.js
+++ b/animism-align/frontend/app/views/align/components/player/playButton.component.js
@@ -1,21 +1,22 @@
-import React, { Component } from 'react'
-import { connect } from 'react-redux'
+import React from 'react'
import actions from 'app/actions'
-const PlayButton = ({ audio }) => {
+const PlayButton = ({ playing, onClick }) => {
return (
<div
- className={audio.playing ? 'playButton playing' : 'playButton paused'}
+ className={playing ? 'playButton playing' : 'playButton paused'}
onClick={() => {
- audio.playing ? actions.audio.pause() : actions.audio.play()
+ if (onClick) {
+ onClick(playing)
+ } else if (playing) {
+ actions.audio.pause()
+ } else {
+ actions.audio.play()
+ }
}}
/>
)
}
-const mapStateToProps = state => ({
- audio: state.audio,
-})
-
-export default connect(mapStateToProps)(PlayButton)
+export default PlayButton