Skip to content

Commit

Permalink
Merge pull request #313 from Riddhi162/patch5
Browse files Browse the repository at this point in the history
fix issue #313
  • Loading branch information
Satyam1923 authored Jun 8, 2024
2 parents d70073d + c866084 commit 2f9b229
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
6 changes: 3 additions & 3 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const App = () => {
const [showSearchResults, setShowSearchResults] = useState(false);
const [topEnglishsongs, setTopEnglishsongs] = useState([]);
const [isEnglishSong, setIsEnglishSong] = useState(false);

const[isPaused,setIsPaused] = useState(false);
// this is for debugging the ui
const [debug, setDebug] = useState(false)
useEffect(() => {
Expand Down Expand Up @@ -153,7 +153,7 @@ const App = () => {
return (
<Router>
<Routes>
<Route path="/settings" element={<Settings />} />
<Route path="/settings" element={<Settings/>} />
<Route path="/" element={
<div>
<div className="ui">
Expand Down Expand Up @@ -256,7 +256,7 @@ const App = () => {
}

</div>
<Section3 setIsEnglishSong={setIsEnglishSong} data={data} index={currplaying} playSong={playSong} topsongs={topsongs} isTopSong={isTopSong} setTopSong={setTopSong} isEnglishSong={isEnglishSong} topEnglishsongs={topEnglishsongs} />
<Section3 setIsEnglishSong={setIsEnglishSong} data={data} index={currplaying} playSong={playSong} topsongs={topsongs} isTopSong={isTopSong} setTopSong={setTopSong} isEnglishSong={isEnglishSong} topEnglishsongs={topEnglishsongs} isPaused={isPaused} setIsPaused={setIsPaused}/>
</div>
<Footer/>
</div>
Expand Down
17 changes: 10 additions & 7 deletions frontend/src/components/Section3.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@ import { IoSettings } from "react-icons/io5";
import { Link } from "react-router-dom";


const Section3 = ({ data, setIsEnglishSong, index, topsongs, playSong, isTopSong, setTopSong, isEnglishSong, topEnglishsongs }) => {
const Section3 = ({ data, setIsEnglishSong, index, topsongs, playSong, isTopSong, setTopSong, isEnglishSong, topEnglishsongs, isPaused,setIsPaused}) => {

const decodeEntities = (str) => {
return he.decode(str);
};

const togglePause = () => {
setIsPaused(true);
};

return (
<div className='section3'>
<div className="links">
<div className="link"><IoIosLogIn fontSize={"25px"} color={"white"} /></div>
<div className="link"><RiNotification3Fill fontSize={"25px"} color={"white"} /></div>
<Link to="/settings">
<Link to="/settings" onClick={togglePause}>
<div className="link"><IoSettings fontSize={"25px"} color={"white"} /></div>
</Link>
</div>
Expand Down Expand Up @@ -60,7 +63,7 @@ const Section3 = ({ data, setIsEnglishSong, index, topsongs, playSong, isTopSong

{
isTopSong || data || isEnglishSong ?
<div className="Card2">
<div className="Card2 border-2">
<div className="details2">

{
Expand Down Expand Up @@ -131,7 +134,7 @@ const Section3 = ({ data, setIsEnglishSong, index, topsongs, playSong, isTopSong
<div className="audioplayer">
{
isTopSong ? <AudioPlayer
autoPlay
autoPlay={!isPaused}
src={topsongs && topsongs[index].downloadUrl[4].url}
preload="metadata"
onError={() => {
Expand All @@ -140,7 +143,7 @@ const Section3 = ({ data, setIsEnglishSong, index, topsongs, playSong, isTopSong
style={{ height: "110px", backgroundColor: "#5773ff", color: "white", borderRadius: "7px" }}
/> :
isEnglishSong ? <AudioPlayer
autoPlay
autoPlay={!isPaused}
src={topEnglishsongs && topEnglishsongs[index].downloadUrl[4].url}
preload="metadata"
onError={() => {
Expand All @@ -150,7 +153,7 @@ const Section3 = ({ data, setIsEnglishSong, index, topsongs, playSong, isTopSong
/> :
data && data.length > 0 && data[index] && (
<AudioPlayer
autoPlay
autoPlay={!isPaused}
src={data && data[index].downloadUrl[4].url}
preload="metadata"
onError={() => {
Expand Down

0 comments on commit 2f9b229

Please sign in to comment.