[IMP] lint, prettier, tsc
This commit is contained in:
committed by
Clément Le Bihan
parent
5ef3885f72
commit
13050e52f9
+15
-13
@@ -32,8 +32,7 @@ const MusicListCC = ({ data, isLoading, refetch }: MusicListCCProps) => {
|
|||||||
const { mutateAsync } = useLikeSongMutation();
|
const { mutateAsync } = useLikeSongMutation();
|
||||||
const user = useQuery(API.getUserInfo);
|
const user = useQuery(API.getUserInfo);
|
||||||
|
|
||||||
const musics = (data ?? [])
|
const musics = (data ?? []).map((song) => {
|
||||||
.map((song) => {
|
|
||||||
const isLiked = song.likedByUsers?.some(({ userId }) => userId === user.data?.id) ?? false;
|
const isLiked = song.likedByUsers?.some(({ userId }) => userId === user.data?.id) ?? false;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -54,39 +53,42 @@ const MusicListCC = ({ data, isLoading, refetch }: MusicListCCProps) => {
|
|||||||
return <LoadingView />;
|
return <LoadingView />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return <MusicList initialMusics={musics} musicsPerPage={25} />;
|
||||||
<MusicList
|
|
||||||
initialMusics={musics}
|
|
||||||
musicsPerPage={25}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const FavoritesMusic = () => {
|
const FavoritesMusic = () => {
|
||||||
const likedSongs = useQuery(API.getLikedSongs(['artist', 'SongHistory', 'likedByUsers']));
|
const likedSongs = useQuery(API.getLikedSongs(['artist', 'SongHistory', 'likedByUsers']));
|
||||||
return <MusicListCC
|
return (
|
||||||
data={likedSongs.data?.map(x => x.song)}
|
<MusicListCC
|
||||||
|
data={likedSongs.data?.map((x) => x.song)}
|
||||||
isLoading={likedSongs.isLoading}
|
isLoading={likedSongs.isLoading}
|
||||||
refetch={likedSongs.refetch}
|
refetch={likedSongs.refetch}
|
||||||
/>
|
/>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const RecentlyPlayedMusic = () => {
|
const RecentlyPlayedMusic = () => {
|
||||||
const playHistory = useQuery(API.getUserPlayHistory(['artist', 'SongHistory', 'likedByUsers']));
|
const playHistory = useQuery(API.getUserPlayHistory(['artist', 'SongHistory', 'likedByUsers']));
|
||||||
return <MusicListCC
|
return (
|
||||||
data={playHistory.data?.filter(x => x.song !== undefined).map(x => x.song) as Song[]}
|
<MusicListCC
|
||||||
|
data={
|
||||||
|
playHistory.data?.filter((x) => x.song !== undefined).map((x) => x.song) as Song[]
|
||||||
|
}
|
||||||
isLoading={playHistory.isLoading}
|
isLoading={playHistory.isLoading}
|
||||||
refetch={playHistory.refetch}
|
refetch={playHistory.refetch}
|
||||||
/>
|
/>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const StepUpMusic = () => {
|
const StepUpMusic = () => {
|
||||||
const nextStep = useQuery(API.getSongSuggestions(['artist', 'SongHistory', 'likedByUsers']));
|
const nextStep = useQuery(API.getSongSuggestions(['artist', 'SongHistory', 'likedByUsers']));
|
||||||
return <MusicListCC
|
return (
|
||||||
|
<MusicListCC
|
||||||
data={nextStep.data ?? []}
|
data={nextStep.data ?? []}
|
||||||
isLoading={nextStep.isLoading}
|
isLoading={nextStep.isLoading}
|
||||||
refetch={nextStep.refetch}
|
refetch={nextStep.refetch}
|
||||||
/>
|
/>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderScene = SceneMap({
|
const renderScene = SceneMap({
|
||||||
|
|||||||
Reference in New Issue
Block a user