From 179fdade987a0dd48c99cd001986a73851a925d0 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Mon, 16 Aug 2021 23:41:07 -0700 Subject: [PATCH] remove player context --- src/components/player/Player.tsx | 7 +- src/components/player/PlayerBar.tsx | 212 ++++++++++++++-------------- 2 files changed, 106 insertions(+), 113 deletions(-) diff --git a/src/components/player/Player.tsx b/src/components/player/Player.tsx index 356d7e1..c50ff9f 100644 --- a/src/components/player/Player.tsx +++ b/src/components/player/Player.tsx @@ -1,5 +1,4 @@ import React, { - createContext, useRef, useEffect, useImperativeHandle, @@ -17,8 +16,6 @@ import { setAutoIncremented, } from '../../redux/playQueueSlice'; -export const PlayerContext = createContext({}); - const Player = ({ children }: any, ref: any) => { const player1Ref = useRef(); const player2Ref = useRef(); @@ -150,7 +147,7 @@ const Player = ({ children }: any, ref: any) => { }; return ( - + <> { autoPlay={playQueue.player2.index === playQueue.currentIndex} /> {children} - + ); }; diff --git a/src/components/player/PlayerBar.tsx b/src/components/player/PlayerBar.tsx index ad9c519..da80d1a 100644 --- a/src/components/player/PlayerBar.tsx +++ b/src/components/player/PlayerBar.tsx @@ -130,115 +130,111 @@ const PlayerBar = () => { }; return ( - - - - - -
Is seeking: {isDragging ? 'true' : 'false'}
-
-
- - - - - - - console.log('Set Repeat')} - /> - - - + + + + +
Is seeking: {isDragging ? 'true' : 'false'}
+
+
+ + + + + + + console.log('Set Repeat')} + /> + + + + - - {format((isDragging ? manualSeek : seek) * 1000)} - - - - - - {format( - playQueue.entry[playQueue.currentIndex]?.duration * 1000 || - 0 - )} - - - - - - - 0.7 - ? 'volume-up' - : playQueue.volume < 0.3 - ? 'volume-off' - : 'volume-down' - } - size="lg" - style={{ marginRight: '15px' }} - /> - - - -
-
-
+ {format((isDragging ? manualSeek : seek) * 1000)} + + + + + + {format( + playQueue.entry[playQueue.currentIndex]?.duration * 1000 || 0 + )} + + + + + + + 0.7 + ? 'volume-up' + : playQueue.volume < 0.3 + ? 'volume-off' + : 'volume-down' + } + size="lg" + style={{ marginRight: '15px' }} + /> + + + + + ); };