diff options
Diffstat (limited to 'animism-align/frontend/app/views/editor/align/components/player/playButton.component.js')
| -rw-r--r-- | animism-align/frontend/app/views/editor/align/components/player/playButton.component.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/animism-align/frontend/app/views/editor/align/components/player/playButton.component.js b/animism-align/frontend/app/views/editor/align/components/player/playButton.component.js new file mode 100644 index 0000000..f411941 --- /dev/null +++ b/animism-align/frontend/app/views/editor/align/components/player/playButton.component.js @@ -0,0 +1,22 @@ +import React from 'react' + +import actions from 'app/actions' + +const PlayButton = ({ playing, onClick }) => { + return ( + <div + className={playing ? 'playButton playing' : 'playButton paused'} + onClick={() => { + if (onClick) { + onClick(playing) + } else if (playing) { + actions.audio.pause() + } else { + actions.audio.play() + } + }} + /> + ) +} + +export default PlayButton |
