Front: remove Visible IDs

This commit is contained in:
Arthur Jamet
2023-12-22 10:28:55 +01:00
committed by Clément Le Bihan
parent 339e808d27
commit e85a959c26
5 changed files with 10 additions and 8 deletions
+5 -3
View File
@@ -89,9 +89,11 @@ const PlayViewControlBar = ({
<Text color={textColor[800]} fontSize={14} maxW={'100%'} isTruncated> <Text color={textColor[800]} fontSize={14} maxW={'100%'} isTruncated>
{song.name} {song.name}
</Text> </Text>
<Text color={textColor[900]} fontSize={12} maxW={'100%'} isTruncated> {song.artist && (
{song.artistId} <Text color={textColor[900]} fontSize={12} maxW={'100%'} isTruncated>
</Text> {song.artist?.name}
</Text>
)}
</View> </View>
</View> </View>
</View> </View>
+2 -2
View File
@@ -29,7 +29,7 @@ const swaToSongCardProps = (song: Song) => ({
songId: song.id, songId: song.id,
name: song.name, name: song.name,
artistName: song.artist!.name, artistName: song.artist!.name,
cover: song.cover cover: song.cover,
}); });
const HomeSearchComponent = () => { const HomeSearchComponent = () => {
@@ -83,7 +83,7 @@ type SongsSearchComponentProps = {
const SongsSearchComponent = (props: SongsSearchComponentProps) => { const SongsSearchComponent = (props: SongsSearchComponentProps) => {
const navigation = useNavigation(); const navigation = useNavigation();
const { songData } = React.useContext(SearchContext); const { songData } = React.useContext(SearchContext);
const favoritesQuery = useQuery(API.getLikedSongs()); const favoritesQuery = useQuery(API.getLikedSongs(['artist']));
const handleFavoriteButton = async (state: boolean, songId: number): Promise<void> => { const handleFavoriteButton = async (state: boolean, songId: number): Promise<void> => {
if (state == false) await API.removeLikedSong(songId); if (state == false) await API.removeLikedSong(songId);
+1 -1
View File
@@ -54,7 +54,7 @@ const SongRow = ({ song, onPress, handleLike, isLiked }: SongRowProps) => {
}} }}
fontSize={'sm'} fontSize={'sm'}
> >
{song.artistId ?? 'artist'} {song.artist?.name ?? ''}
</Text> </Text>
{/* <DurationInfo length={song.details.length} /> */} {/* <DurationInfo length={song.details.length} /> */}
<DurationComponent length={song.details.length} /> <DurationComponent length={song.details.length} />
+1 -1
View File
@@ -49,7 +49,7 @@ const ArtistDetailsView = ({ artistId }: RouteProps<ArtistDetailsViewProps>) =>
{songsQuery.data.map((comp: Song, index: Key | null | undefined) => ( {songsQuery.data.map((comp: Song, index: Key | null | undefined) => (
<SongRow <SongRow
key={index} key={index}
song={comp} song={{ ...comp, artist: artistQuery.data }}
isLiked={ isLiked={
!favoritesQuery.data?.find((query) => query?.songId == comp.id) !favoritesQuery.data?.find((query) => query?.songId == comp.id)
} }
+1 -1
View File
@@ -74,7 +74,7 @@ const PlayView = ({ songId, route }: RouteProps<PlayViewProps>) => {
const navigation = useNavigation(); const navigation = useNavigation();
const screenSize = useBreakpointValue({ base: 'small', md: 'big' }); const screenSize = useBreakpointValue({ base: 'small', md: 'big' });
const isPhone = screenSize === 'small'; const isPhone = screenSize === 'small';
const song = useQuery(API.getSong(songId), { staleTime: Infinity }); const song = useQuery(API.getSong(songId, ['artist']), { staleTime: Infinity });
const toast = useToast(); const toast = useToast();
const [lastScoreMessage, setLastScoreMessage] = useState<ScoreMessage>(); const [lastScoreMessage, setLastScoreMessage] = useState<ScoreMessage>();
const webSocket = useRef<WebSocket>(); const webSocket = useRef<WebSocket>();