From fa287a8b341926fa3866d7dee31b4f4090a5c98f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 2 Dec 2020 15:00:48 +0100 Subject: starting full video modal --- .../align/components/player/playButton.component.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'animism-align/frontend/app/views/align/components/player/playButton.component.js') 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 (
{ - 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 -- cgit v1.2.3-70-g09d2