Front: Remove use of external images for placeholders

This commit is contained in:
Arthur Jamet
2023-12-19 11:48:47 +01:00
committed by Clément Le Bihan
parent fb0e43af88
commit e90c7f05a8
4 changed files with 5 additions and 17 deletions
+2 -8
View File
@@ -3,7 +3,7 @@ import Card, { CardBorderRadius } from './Card';
import { VStack, Text, Image } from 'native-base'; import { VStack, Text, Image } from 'native-base';
type ArtistCardProps = { type ArtistCardProps = {
image: string; image?: string;
name: string; name: string;
id: number; id: number;
onPress: () => void; onPress: () => void;
@@ -18,6 +18,7 @@ const ArtistCard = (props: ArtistCardProps) => {
<Image <Image
style={{ zIndex: 0, aspectRatio: 1, borderRadius: CardBorderRadius }} style={{ zIndex: 0, aspectRatio: 1, borderRadius: CardBorderRadius }}
source={{ uri: image }} source={{ uri: image }}
fallbackSource={{ uri: require('../assets/icon.jpg') }}
alt={name} alt={name}
/> />
<VStack> <VStack>
@@ -30,11 +31,4 @@ const ArtistCard = (props: ArtistCardProps) => {
); );
}; };
ArtistCard.defaultProps = {
image: 'https://picsum.photos/200',
name: 'Artist',
id: 0,
onPress: () => {},
};
export default ArtistCard; export default ArtistCard;
+1 -6
View File
@@ -30,6 +30,7 @@ const GenreCard = (props: GenreCardProps) => {
source={{ source={{
uri: image, uri: image,
}} }}
fallbackSource={{ uri: require('../assets/icon.jpg') }}
size="md" size="md"
/> />
</Box> </Box>
@@ -43,10 +44,4 @@ const GenreCard = (props: GenreCardProps) => {
); );
}; };
GenreCard.defaultProps = {
icon: 'https://picsum.photos/200',
name: 'Genre',
onPress: () => {},
};
export default GenreCard; export default GenreCard;
+1 -1
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 ?? 'https://picsum.photos/200', cover: song.cover
}); });
const HomeSearchComponent = () => { const HomeSearchComponent = () => {
+1 -2
View File
@@ -2,7 +2,6 @@ import { useEffect } from 'react';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import API from '../API'; import API from '../API';
import { setAccessToken } from '../state/UserSlice'; import { setAccessToken } from '../state/UserSlice';
import { Text } from 'native-base';
import { useRoute } from '@react-navigation/native'; import { useRoute } from '@react-navigation/native';
import { AccessTokenResponseHandler } from '../models/AccessTokenResponse'; import { AccessTokenResponseHandler } from '../models/AccessTokenResponse';
import { Translate } from '../i18n/i18n'; import { Translate } from '../i18n/i18n';
@@ -26,7 +25,7 @@ const GoogleView = () => {
run(); run();
}, []); }, []);
return <Translate translate={'loading'} />; return <Translate translationKey={'loading'} />;
}; };
export default GoogleView; export default GoogleView;