Front: Remove use of external images for placeholders
This commit is contained in:
committed by
Clément Le Bihan
parent
fb0e43af88
commit
e90c7f05a8
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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 = () => {
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user