diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/Player/index.tsx | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/components/Player/index.tsx b/src/components/Player/index.tsx index e5d2d28..fcfce72 100644 --- a/src/components/Player/index.tsx +++ b/src/components/Player/index.tsx @@ -1,6 +1,6 @@ import React from "react"; import YouTube from "react-youtube"; -import { IoPlay } from "react-icons/io5"; +import { IoPlay, IoPause } from "react-icons/io5"; import { playTimes } from "../../constants"; @@ -77,12 +77,22 @@ export function Player({ id, currentTry }: Props) { <Styled.TimeStamp>1s</Styled.TimeStamp> <Styled.TimeStamp>16s</Styled.TimeStamp> </Styled.TimeStamps> - <IoPlay - style={{ cursor: "pointer" }} - size={36} - color="var(--cl-green-6)" - onClick={startPlayback} - /> + {!play && ( + <IoPlay + style={{ cursor: "pointer" }} + size={36} + color="var(--cl-green-6)" + onClick={startPlayback} + /> + )} + {play && ( + <IoPause + style={{ cursor: "pointer" }} + size={36} + color="var(--cl-green-6)" + onClick={startPlayback} + /> + )} </> ) : ( <p>Loading player...</p> |
