diff options
author | 2021-09-12 23:11:25 +0200 | |
---|---|---|
committer | 2021-09-12 23:11:25 +0200 | |
commit | 16dab011c575eaf96630cab406ec2d8086403d0b (patch) | |
tree | af53af45b8cb52317cef3d4d59216b1c58d8d8ff /apps/Player/components/Buttons.js | |
parent | d79f4c0bf3dae76eaae0d36469f5b279272d6944 (diff) | |
download | my_apps-16dab011c575eaf96630cab406ec2d8086403d0b.tar.gz my_apps-16dab011c575eaf96630cab406ec2d8086403d0b.tar.bz2 my_apps-16dab011c575eaf96630cab406ec2d8086403d0b.zip |
added youtube & player apps
Diffstat (limited to 'apps/Player/components/Buttons.js')
-rw-r--r-- | apps/Player/components/Buttons.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/apps/Player/components/Buttons.js b/apps/Player/components/Buttons.js new file mode 100644 index 0000000..14452a0 --- /dev/null +++ b/apps/Player/components/Buttons.js @@ -0,0 +1,34 @@ +import { faStepForward, faStepBackward, faPlay, faStop } from '@fortawesome/free-solid-svg-icons' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' + +const Buttons = ({ current, setCurrent, playlist }) => ( + <> + <span /> + <div + className={current !== null && current > 0 ? '' : 'iconOff'} + onClick={() => { current !== null && current > 0 && setCurrent(c => c - 1) }} + > + <FontAwesomeIcon icon={faStepBackward} /> + </div> + <div + className={current === null ? 'iconOff' : ''} + onClick={() => { current !== null && setCurrent(null) }} + > + <FontAwesomeIcon icon={faStop} /> + </div> + <div + className={current === null ? '' : 'iconOff'} + onClick={() => { current === null && setCurrent(0) }} + > + <FontAwesomeIcon icon={faPlay} /> + </div> + <div + className={current !== null && current < playlist.length - 1 ? '' : 'iconOff'} + onClick={() => { current !== null && current < playlist.length - 1 && setCurrent(c => c + 1) }} + > + <FontAwesomeIcon icon={faStepForward} /> + </div> + </> +) + +export default Buttons |