diff --git a/src/components/MusicComponent.js b/src/components/MusicComponent.js index a35b7a4..75d5394 100644 --- a/src/components/MusicComponent.js +++ b/src/components/MusicComponent.js @@ -121,21 +121,21 @@ const MusicComponent = ({ song, min, max, onDecision }) => { onTouchEnd={handleTouchEnd} style={{ transform: `translateX(${positionX}px)` }} ref={containerRef}> - {song.set &&
-

{song.bePlayed ? "next up" : "skipped"}

} + {song[3] &&
+

{song[4] ? "next up" : "skipped"}

}
{song.name} e.target.src = song.image} + onError={(e) => e.target.src = song[0]?.image || song.image} />
-

{song.name}

-

{song.artist}

- {min < 0 &&

<--- {song.disagree} no - {song.agree} yes --->

} +

{song[0]?.name || song.name}

+

{song[0]?.artist || song.artist}

+ {min < 0 &&

<--- {song[2]?.length} no - {song[1]?.length} yes --->

}
-

{song.length}

+

{song[0]?.length || song.length}

); }; diff --git a/src/components/MusicPlayer.js b/src/components/MusicPlayer.js index a684588..d3df5f6 100644 --- a/src/components/MusicPlayer.js +++ b/src/components/MusicPlayer.js @@ -85,9 +85,9 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo const fetchColor = async () => { if ( currentSong && - currentSong.image + currentSong[0]?.image ) { - const imageUrl = currentSong.image; + const imageUrl = currentSong[0].image; try { const dominantColor = await getDominantColor(imageUrl); // Calculate luminance (YIQ color space) to determine if subtitle should be black or white @@ -429,8 +429,8 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo
- {currentSong && currentSong.name - ? (viewing ? currentSong.name : text) + {currentSong && currentSong[0]?.name + ? (viewing ? currentSong[0]?.name : text) : viewing ? messages[0] : text}
@@ -438,9 +438,8 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo
{ currentSong && - currentSong.image && - currentSong.artist - ? currentSong.artist + currentSong[0]?.artist + ? currentSong[0]?.artist : "Pilih hits terbaikmu dibawah!"}
@@ -512,14 +511,14 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo onDecision(song.trackId, vote)} + min={song[3]? 0 : -100} + max={song[3]? 0 : 100} + onDecision={(vote) => onDecision(song[0].trackId, vote)} /> )) ) } - {songName == "" && queue && queue.length > 0 && queue.length < 3 && ( + {/* {songName == "" && queue && queue.length > 0 && queue.length < 3 && (
Tambahkan musikmu @@ -530,7 +529,7 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo Cari musik
- )} + )} */}