Skip to content

Commit

Permalink
fixed the initial tab content in the charts page
Browse files Browse the repository at this point in the history
  • Loading branch information
dauletalzhanov committed May 7, 2024
1 parent 2c1c6b2 commit 57d8b5a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/Components/Ranking.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState, useEffect } from "react"
import { Link } from "react-router-dom"

function Ranking({title, url}){
function Ranking({title, url, invisible}){
const [songs, setSongs] = useState([])

useEffect(()=>{
Expand All @@ -16,7 +16,7 @@ function Ranking({title, url}){
}, [])


return(<div className="ranking">
return(<div className={`ranking ${invisible?"invisible":""}`}>
<p className="ranking-title">{title}</p>

{songs.map((song, index) => {
Expand Down
4 changes: 2 additions & 2 deletions src/Pages/CSS/charts_mobile.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
}

.billboard-title > h1 {
font-size: 6vw;
font-size: 5vw;
}

.billboard-title > p {
font-size: 3.5vw;
font-size: 3vw;
}

/**************************/
Expand Down
10 changes: 2 additions & 8 deletions src/Pages/Charts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,9 @@ export default function Charts() {
<p onClick={handleGlobal}>Global</p>
</div>

<Ranking title='Albums' url={url200} />
<Ranking title='Albums' url={url200} invisible={true} />
<Ranking title='Songs' url={url100} />
<Ranking title='Global' url={urlGlo} />






<Ranking title='Global' url={urlGlo} invisible={true} />

</div>

Expand Down
10 changes: 3 additions & 7 deletions src/Pages/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,9 @@ export default function Search(){
const id = event.target.getAttribute("id")
const song = searchResults[id]



//let music = new Audio(song.previewUrl)
//await music.play()
setMusicSrc(song.previewUrl)
dispatch(playTrack(song.previewUrl))

//const walkman = document.querySelector("audio").parentNode
//if(walkman.classList.contains("invisible") == true)
// walkman.classList.toggle("invisible")
}


Expand All @@ -190,6 +183,9 @@ export default function Search(){
</div>

<main>
<div>

</div>
<ul className="results">
{ searchResults.length == 0 ? "No Songs Here" : searchResults.map((song, index)=> {

Expand Down

0 comments on commit 57d8b5a

Please sign in to comment.