Front: Lint + format

This commit is contained in:
Arthur Jamet
2023-12-28 09:38:32 +01:00
committed by Clément Le Bihan
parent 4e3b378d6a
commit 60a73781bd
3 changed files with 6 additions and 13 deletions

View File

@@ -85,11 +85,6 @@ const SongsSearchComponent = (props: SongsSearchComponentProps) => {
const navigation = useNavigation();
const { songData } = React.useContext(SearchContext);
const favoritesQuery = useQuery(API.getLikedSongs(['artist']));
const handleFavoriteButton = async (state: boolean, songId: number): Promise<void> => {
if (state == false) await API.removeLikedSong(songId);
else await API.addLikedSong(songId);
};
const { mutate } = useLikeSongMutation();
return (

View File

@@ -236,6 +236,10 @@ const styles = StyleSheet.create({
// Using `memo` to optimize rendering performance by memorizing the component's output.
// This ensures that the component only re-renders when its props change.
const MusicList = memo(MusicListComponent);
const MusicList = memo(MusicListComponent, (prev, next) => {
console.log('AAAAA');
console.log(prev.initialMusics, next.initialMusics);
return prev.initialMusics.length == next.initialMusics.length;
});
export default MusicList;

View File

@@ -2,13 +2,7 @@ import Song from '../../models/Song';
import React from 'react';
import { LikeButton } from './SongCardInfoLikeBtn';
import { Image, Platform, View } from 'react-native';
import {
Pressable,
Text,
PresenceTransition,
Icon,
useBreakpointValue,
} from 'native-base';
import { Pressable, Text, PresenceTransition, Icon, useBreakpointValue } from 'native-base';
import { Ionicons } from '@expo/vector-icons';
import { useQuery } from '../../Queries';
import API from '../../API';