diff --git a/front/Navigation.tsx b/front/Navigation.tsx index 12a4bbc..14a9d5f 100644 --- a/front/Navigation.tsx +++ b/front/Navigation.tsx @@ -10,7 +10,6 @@ import { DarkTheme, DefaultTheme, NavigationContainer } from '@react-navigation/ import { RootState, useSelector } from './state/Store'; import { useDispatch } from 'react-redux'; import { Translate, translate } from './i18n/i18n'; -import SongLobbyView from './views/SongLobbyView'; import HomeView from './views/HomeView'; import SearchView from './views/SearchView'; import SettingsTab from './views/settings/SettingsView'; @@ -65,11 +64,6 @@ const protectedRoutes = () => screen: removeMe, }, }, - Song: { - component: SongLobbyView, - options: { title: translate('play') }, - link: '/song/:songId', - }, Artist: { component: ArtistDetailsView, options: { title: translate('artistFilter') }, diff --git a/front/components/SearchResult.tsx b/front/components/SearchResult.tsx index ef4c1ee..08c1aff 100644 --- a/front/components/SearchResult.tsx +++ b/front/components/SearchResult.tsx @@ -140,7 +140,7 @@ const SongsSearchComponent = (props: SongsSearchComponentProps) => { } onPress={() => { API.createSearchHistoryEntry(comp.name, 'song'); - navigation.navigate('Song', { songId: comp.id }); + navigation.navigate('Play', { songId: comp.id }); }} /> )) @@ -253,7 +253,7 @@ const FavoritesComponent = () => { FavSong={songData} onPress={() => { API.createSearchHistoryEntry(songData.details!.name, 'song'); //todo - navigation.navigate('Song', { songId: songData.details!.id }); //todo + navigation.navigate('Play', { songId: songData.details!.id }); }} /> ))} diff --git a/front/components/SongCard.tsx b/front/components/SongCard.tsx index 439bdeb..8918bde 100644 --- a/front/components/SongCard.tsx +++ b/front/components/SongCard.tsx @@ -13,7 +13,7 @@ const SongCard = (props: SongCardProps) => { const { cover, name, artistName, songId } = props; const navigation = useNavigation(); return ( - navigation.navigate('Song', { songId })}> + navigation.navigate('Play', { songId })}> { flex: 1, }} > - navigation.navigate('Song', { songId: song.id })}> + navigation.navigate('Play', { songId: song.id })}> {song.name} diff --git a/front/views/ArtistDetailsView.tsx b/front/views/ArtistDetailsView.tsx index bfb8781..d4b47df 100644 --- a/front/views/ArtistDetailsView.tsx +++ b/front/views/ArtistDetailsView.tsx @@ -58,7 +58,7 @@ const ArtistDetailsView = ({ artistId }: RouteProps) => } onPress={() => { API.createSearchHistoryEntry(comp.name, 'song'); - navigation.navigate('Song', { songId: comp.id }); + navigation.navigate('Play', { songId: comp.id }); }} /> ))} diff --git a/front/views/GenreDetailsView.tsx b/front/views/GenreDetailsView.tsx index e9c632e..fc495d8 100644 --- a/front/views/GenreDetailsView.tsx +++ b/front/views/GenreDetailsView.tsx @@ -61,7 +61,7 @@ const GenreDetailsView = ({ genreId }: RouteProps) => { songId: songData.id, onPress: () => { API.createSearchHistoryEntry(songData.name, 'song'); - navigation.navigate('Song', { songId: songData.id }); + navigation.navigate('Play', { songId: songData.id }); }, }))} cardComponent={SongCard} diff --git a/front/views/MusicView.tsx b/front/views/MusicView.tsx index 01a1161..e9a8d59 100644 --- a/front/views/MusicView.tsx +++ b/front/views/MusicView.tsx @@ -59,7 +59,7 @@ export const FavoritesMusic = () => { onLike: () => { console.log('onLike'); }, - onPlay: () => navigation.navigate('Song', { songId: song.id }), + onPlay: () => navigation.navigate('Play', { songId: song.id }), })) ?? []; if (isLoading) { diff --git a/front/views/PlayView.tsx b/front/views/PlayView.tsx index b7adea0..ec5d972 100644 --- a/front/views/PlayView.tsx +++ b/front/views/PlayView.tsx @@ -36,7 +36,6 @@ import { useTheme } from 'native-base'; type PlayViewProps = { songId: number; - type: 'practice' | 'normal'; }; type ScoreMessage = { @@ -97,7 +96,8 @@ const infoCardInfos = [ }, ] as const; -const PlayView = ({ songId, type, route }: RouteProps) => { +const PlayView = ({ songId, route }: RouteProps) => { + const [type, setType] = useState<'practice' | 'normal'>('normal'); const accessToken = useSelector((state: RootState) => state.user.accessToken); const navigation = useNavigation(); const song = useQuery(API.getSong(songId), { staleTime: Infinity }); diff --git a/front/views/ScoreView.tsx b/front/views/ScoreView.tsx index a2cc50b..cd27420 100644 --- a/front/views/ScoreView.tsx +++ b/front/views/ScoreView.tsx @@ -163,7 +163,7 @@ const ScoreView = (props: RouteProps) => { onPress={() => navigation.navigate('Home', {})} /> navigation.navigate('Song', { songId })} + onPress={() => navigation.navigate('Play', { songId })} translate={{ translationKey: 'playAgain' }} /> diff --git a/front/views/V2/DiscoveryView.tsx b/front/views/V2/DiscoveryView.tsx index 7f4d200..0ac8e68 100644 --- a/front/views/V2/DiscoveryView.tsx +++ b/front/views/V2/DiscoveryView.tsx @@ -72,7 +72,7 @@ const HomeView = (props: RouteProps<{}>) => { (artistQuery) => artistQuery.data?.id === song.artistId )!.data!.name; cards[index]!.onPress = () => { - navigation.navigate('Song', { songId: song.id }); + navigation.navigate('Play', { songId: song.id }); }; }); }, [artistsQueries]); @@ -195,7 +195,7 @@ const HomeView = (props: RouteProps<{}>) => { key={song.id} song={song} onPress={() => { - navigation.navigate('Song', { songId: song.id }); + navigation.navigate('Play', { songId: song.id }); }} onPlay={() => { console.log('play');