From dea8528eadc6a737eb08f3a3fe9bc53d238d58c7 Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Mon, 18 Jan 2021 15:53:42 +0000 Subject: [PATCH] Add material player --- package.json | 1 + src/components/TuneList.tsx | 4 +- src/components/TunePlayer.tsx | 77 ++++++++++++++++++++++++++++++++ src/components/YouTubePlayer.tsx | 11 ----- yarn.lock | 12 +++++ 5 files changed, 92 insertions(+), 13 deletions(-) create mode 100644 src/components/TunePlayer.tsx delete mode 100644 src/components/YouTubePlayer.tsx diff --git a/package.json b/package.json index 7c67c0a..66d646b 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@types/node": "^14.14.21", "@types/react": "^16.9.53", "@types/react-dom": "^16.9.8", + "material-ui-audio-player": "^1.5.3", "react": "^17.0.1", "react-dom": "^17.0.1", "react-scripts": "4.0.1", diff --git a/src/components/TuneList.tsx b/src/components/TuneList.tsx index 769f70f..a5e25bd 100644 --- a/src/components/TuneList.tsx +++ b/src/components/TuneList.tsx @@ -10,7 +10,7 @@ import { import React, { useEffect, useState } from "react"; import Tune from "../models/tune"; import TuneTitle from "./TuneTitle"; -import YouTubePlayer from "./YouTubePlayer"; +import TunePlayer from "./TunePlayer"; const MixList = () => { const [tunes, setTunes] = useState([]); @@ -51,7 +51,7 @@ const MixList = () => { - { + return { + root: { + [theme.breakpoints.down("sm")]: { + width: "100%", + }, + }, + loopIcon: { + color: "#3f51b5", + "&.selected": { + color: "#0921a9", + }, + "&:hover": { + color: "#7986cb", + }, + [theme.breakpoints.down("sm")]: { + display: "none", + }, + }, + playIcon: { + color: "#f50057", + "&:hover": { + color: "#ff4081", + }, + }, + volumeIcon: { + color: "rgba(0, 0, 0, 0.54)", + }, + volumeSlider: { + color: "black", + }, + progressTime: { + color: "rgba(0, 0, 0, 0.54)", + }, + mainSlider: { + color: "#3f51b5", + "& .MuiSlider-rail": { + color: "#7986cb", + }, + "& .MuiSlider-track": { + color: "#3f51b5", + }, + "& .MuiSlider-thumb": { + color: "#303f9f", + }, + }, + }; +}); + +const TunePlayer = (props: { videoId: string; index: number }) => { + return ( + + + + ); +}; + +export default TunePlayer; diff --git a/src/components/YouTubePlayer.tsx b/src/components/YouTubePlayer.tsx deleted file mode 100644 index dbcbf1c..0000000 --- a/src/components/YouTubePlayer.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from "react"; - -const YouTubePlayer = (props: { videoId: string; index: number }) => { - return ( -