mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 19:21:10 +02:00
Combines LightWrite (beat/lyrics editor) and Mukke (iOS music player) into a single web-based music workspace app. Archives the old Mukke mobile app. - Rename: @lightwrite/* → @mukke/*, all branding, configs, Dockerfiles - New DB schemas: songs, playlists, playlist_songs + songId FK on projects - New backend modules: SongModule, PlaylistModule, LibraryModule - New web: app shell with sidebar, library (songs/albums/artists/genres), web player (queue/shuffle/repeat/MediaSession), playlists, search, upload, dashboard, album/artist/genre detail pages - Auth: add forgot-password + reset-password pages, extend auth store - Tests: 40 backend unit tests (song, playlist, library services) - Config: env generation, MinIO bucket, docker-compose prod, cloudflare - Docs: update CLAUDE.md, auth guidelines with SvelteKit checklist Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
72 lines
1.9 KiB
TypeScript
72 lines
1.9 KiB
TypeScript
import { Stack } from 'expo-router';
|
|
import { useEffect } from 'react';
|
|
import { View } from 'react-native';
|
|
|
|
import { AlbumGrid } from '~/components/AlbumGrid';
|
|
import { ArtistList } from '~/components/ArtistList';
|
|
import { GenreList } from '~/components/GenreList';
|
|
import { ImportButton } from '~/components/ImportButton';
|
|
import { SegmentedControl } from '~/components/SegmentedControl';
|
|
import { SongList } from '~/components/SongList';
|
|
import { SortMenu } from '~/components/SortMenu';
|
|
import { useLibraryStore } from '~/stores/libraryStore';
|
|
import type { LibraryTab } from '~/types';
|
|
|
|
const SEGMENTS: { key: LibraryTab; label: string }[] = [
|
|
{ key: 'songs', label: 'Songs' },
|
|
{ key: 'albums', label: 'Alben' },
|
|
{ key: 'artists', label: 'Künstler' },
|
|
{ key: 'genres', label: 'Genres' },
|
|
];
|
|
|
|
export default function LibraryScreen() {
|
|
const {
|
|
songs,
|
|
albums,
|
|
artists,
|
|
genres,
|
|
activeTab,
|
|
sortField,
|
|
sortDirection,
|
|
setActiveTab,
|
|
setSortField,
|
|
setSortDirection,
|
|
loadAll,
|
|
} = useLibraryStore();
|
|
|
|
useEffect(() => {
|
|
loadAll();
|
|
}, []);
|
|
|
|
return (
|
|
<View style={{ flex: 1 }}>
|
|
<Stack.Screen
|
|
options={{
|
|
title: 'Bibliothek',
|
|
headerRight: () => (
|
|
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
{activeTab === 'songs' && (
|
|
<SortMenu
|
|
currentField={sortField}
|
|
currentDirection={sortDirection}
|
|
onSort={(field, dir) => {
|
|
setSortField(field);
|
|
setSortDirection(dir);
|
|
}}
|
|
/>
|
|
)}
|
|
<ImportButton />
|
|
</View>
|
|
),
|
|
}}
|
|
/>
|
|
|
|
<SegmentedControl segments={SEGMENTS} selected={activeTab} onSelect={setActiveTab} />
|
|
|
|
{activeTab === 'songs' && <SongList songs={songs} />}
|
|
{activeTab === 'albums' && <AlbumGrid albums={albums} />}
|
|
{activeTab === 'artists' && <ArtistList artists={artists} />}
|
|
{activeTab === 'genres' && <GenreList genres={genres} />}
|
|
</View>
|
|
);
|
|
}
|