fix(mobile): remove songs header temporarily

This commit is contained in:
joshuafhiggins authored and Joshua Higgins committed 2026-08-02 04:14:01 +00:00
1 parent 89f8d2e23f
commit 98977a8d91
1 file changed
+18 -23
@@ -2,7 +2,10 @@ import { usePaginatedQuery } from "convex/react"
import { useState } from "react"
import { FlatList, Pressable, StyleSheet, Text, View } from "react-native"
import { MediaActionsSheet, type MediaAction } from "@/components/media-actions-sheet"
import {
MediaActionsSheet,
type MediaAction,
} from "@/components/media-actions-sheet"
import { contentBottomInset, SongRow } from "@/components/player"
import { LoadingView } from "@/components/ui/primitives"
import { useAddToPlaylist } from "@/contexts/add-to-playlist"
@@ -18,7 +21,8 @@ const PAGE_SIZE = 50
export default function SongsScreen() {
const colors = useThemeColors()
const { playFromLibrarySong, addToQueueNext, addToQueueLast, playShuffled } = usePlayback()
const { playFromLibrarySong, addToQueueNext, addToQueueLast, playShuffled } =
usePlayback()
const { openAddToPlaylist } = useAddToPlaylist()
const { isSongFavorite, toggleSongFavorite } = useFavorites()
const [sortKey, setSortKey] = useState<"title" | "artist" | "album">("title")
@@ -48,10 +52,14 @@ export default function SongsScreen() {
openAddToPlaylist(songIds)
break
case "play-next":
void addToQueueNext(songIds).then(() => showSuccess("Queued to play next"))
void addToQueueNext(songIds).then(() =>
showSuccess("Queued to play next")
)
break
case "play-last":
void addToQueueLast(songIds).then(() => showSuccess("Queued to play last"))
void addToQueueLast(songIds).then(() =>
showSuccess("Queued to play last")
)
break
case "shuffle":
void playShuffled(songIds)
@@ -69,23 +77,7 @@ export default function SongsScreen() {
}
return (
<View style={{ flex: 1, backgroundColor: colors.background }}>
<View style={[styles.sortRow, { borderBottomColor: colors.border }]}>
{(["title", "artist", "album"] as const).map((key) => (
<Pressable key={key} onPress={() => cycleSort(key)} style={styles.sortButton}>
<Text
style={{
color: sortKey === key ? colors.foreground : colors.mutedForeground,
fontWeight: sortKey === key ? "700" : "500",
}}
>
{key[0].toUpperCase() + key.slice(1)}
{sortKey === key ? (sortDirection === "asc" ? " ↑" : " ↓") : ""}
</Text>
</Pressable>
))}
</View>
<>
<FlatList
data={results}
keyExtractor={(item) => item.id}
@@ -99,7 +91,10 @@ export default function SongsScreen() {
<SongRow
song={item}
onPress={() =>
void playFromLibrarySong(item.id as Id<"songs">, { sortKey, sortDirection })
void playFromLibrarySong(item.id as Id<"songs">, {
sortKey,
sortDirection,
})
}
onLongPress={() => setActionSong(item)}
/>
@@ -113,7 +108,7 @@ export default function SongsScreen() {
onClose={() => setActionSong(null)}
onAction={handleAction}
/>
</View>
</>
)
}