mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 15:02:42 +01:00
impl shuffle, controls are temp
This commit is contained in:
@@ -26,7 +26,8 @@ const AlbumDetails: React.FC<{
|
||||
const Songs = () => (
|
||||
<>
|
||||
<View style={styles.controls}>
|
||||
<Button title="Play Album" onPress={() => setQueue(album.songs, album.name, album.songs[0].id)} />
|
||||
<Button title="Play Album" onPress={() => setQueue(album.songs, album.name, undefined, false)} />
|
||||
<Button title="Shuffle" onPress={() => setQueue(album.songs, album.name, undefined, true)} />
|
||||
</View>
|
||||
<View style={styles.songs}>
|
||||
{album.songs
|
||||
@@ -37,8 +38,8 @@ const AlbumDetails: React.FC<{
|
||||
return a.title.localeCompare(b.title)
|
||||
}
|
||||
})
|
||||
.map(s => (
|
||||
<SongItem key={s.id} song={s} onPress={() => setQueue(album.songs, album.name, s.id)} />
|
||||
.map((s, i) => (
|
||||
<SongItem key={i} song={s} onPress={() => setQueue(album.songs, album.name, i)} />
|
||||
))}
|
||||
</View>
|
||||
</>
|
||||
|
||||
@@ -48,13 +48,13 @@ const ArtistDetails: React.FC<{ id: string }> = ({ id }) => {
|
||||
const TopSongs = () => (
|
||||
<>
|
||||
<Text style={styles.header}>Top Songs</Text>
|
||||
{artist.topSongs.map(s => (
|
||||
{artist.topSongs.map((s, i) => (
|
||||
<SongItem
|
||||
key={s.id}
|
||||
key={i}
|
||||
song={s}
|
||||
showArt={true}
|
||||
subtitle="album"
|
||||
onPress={() => setQueue(artist.topSongs, `Top Songs: ${artist.name}`, s.id)}
|
||||
onPress={() => setQueue(artist.topSongs, `Top Songs: ${artist.name}`, i)}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
|
||||
@@ -26,11 +26,11 @@ const PlaylistDetails: React.FC<{
|
||||
const Songs = () => (
|
||||
<>
|
||||
<View style={styles.controls}>
|
||||
<Button title="Play Playlist" onPress={() => setQueue(playlist.songs, playlist.name, playlist.songs[0].id)} />
|
||||
<Button title="Play Playlist" onPress={() => setQueue(playlist.songs, playlist.name)} />
|
||||
</View>
|
||||
<View style={styles.songs}>
|
||||
{playlist.songs.map((s, index) => (
|
||||
<SongItem key={index} song={s} showArt={true} onPress={() => setQueue(playlist.songs, playlist.name, s.id)} />
|
||||
{playlist.songs.map((s, i) => (
|
||||
<SongItem key={i} song={s} showArt={true} onPress={() => setQueue(playlist.songs, playlist.name, i)} />
|
||||
))}
|
||||
</View>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user