- Replace mobile placeholder with Expo Router app (tabs, playback, auth, library) - Move Convex backend to @otunes/convex for web and mobile reuse - Update web app imports and API routes to use shared package
68 lines
2.3 KiB
TypeScript
68 lines
2.3 KiB
TypeScript
import { useRouter } from "expo-router"
|
|
import { Pressable, ScrollView, StyleSheet, Text, View } from "react-native"
|
|
import { SafeAreaView } from "react-native-safe-area-context"
|
|
import { Ionicons } from "@expo/vector-icons"
|
|
|
|
import { ScreenHeader } from "@/components/screen-header"
|
|
import { contentBottomInset } from "@/components/player"
|
|
import { radius, spacing, useThemeColors } from "@/lib/theme"
|
|
|
|
const links = [
|
|
{ title: "Albums", href: "/library/albums", icon: "disc" as const },
|
|
{ title: "Artists", href: "/library/artists", icon: "mic" as const },
|
|
{ title: "Songs", href: "/library/songs", icon: "musical-notes" as const },
|
|
{ title: "Recently Played", href: "/recently-played", icon: "time" as const },
|
|
{ title: "Recently Added", href: "/recently-added", icon: "sparkles" as const },
|
|
{ title: "Favorites", href: "/playlist/favorites", icon: "star" as const },
|
|
]
|
|
|
|
export default function LibraryScreen() {
|
|
const router = useRouter()
|
|
const colors = useThemeColors()
|
|
|
|
return (
|
|
<SafeAreaView style={[styles.safe, { backgroundColor: colors.background }]} edges={["top"]}>
|
|
<ScreenHeader title="Library" />
|
|
<ScrollView contentContainerStyle={{ paddingBottom: contentBottomInset }}>
|
|
{links.map((link) => (
|
|
<Pressable
|
|
key={link.href}
|
|
style={[styles.row, { borderBottomColor: colors.border }]}
|
|
onPress={() => router.push(link.href as never)}
|
|
>
|
|
<View style={[styles.iconWrap, { backgroundColor: colors.muted }]}>
|
|
<Ionicons name={link.icon} size={20} color={colors.foreground} />
|
|
</View>
|
|
<Text style={[styles.rowTitle, { color: colors.foreground }]}>{link.title}</Text>
|
|
<Ionicons name="chevron-forward" size={18} color={colors.mutedForeground} />
|
|
</Pressable>
|
|
))}
|
|
</ScrollView>
|
|
</SafeAreaView>
|
|
)
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
safe: { flex: 1 },
|
|
row: {
|
|
flexDirection: "row",
|
|
alignItems: "center",
|
|
gap: spacing.md,
|
|
paddingHorizontal: spacing.lg,
|
|
paddingVertical: spacing.md,
|
|
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
},
|
|
iconWrap: {
|
|
width: 40,
|
|
height: 40,
|
|
borderRadius: radius.md,
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
},
|
|
rowTitle: {
|
|
flex: 1,
|
|
fontSize: 16,
|
|
fontWeight: "600",
|
|
},
|
|
})
|