feat: artist illustrations
This commit is contained in:
committed by
Clément Le Bihan
parent
7f51582043
commit
3553954afd
@@ -1,26 +1,24 @@
|
||||
import React from "react";
|
||||
import Card, { CardBorderRadius } from './Card';
|
||||
import { VStack, Text, Image } from 'native-base';
|
||||
import Card, { CardBorderRadius } from "./Card";
|
||||
import { VStack, Text, Image } from "native-base";
|
||||
import API from "../API";
|
||||
|
||||
type ArtistCardProps = {
|
||||
image: string;
|
||||
name: string;
|
||||
id: number;
|
||||
onPress: () => void;
|
||||
}
|
||||
};
|
||||
|
||||
const ArtistCard = (props: ArtistCardProps) => {
|
||||
const { image, name, id } = props;
|
||||
|
||||
return (
|
||||
<Card
|
||||
shadow={3}
|
||||
onPress={props.onPress}
|
||||
>
|
||||
<Card shadow={3} onPress={props.onPress}>
|
||||
<VStack m={1.5} space={3}>
|
||||
<Image
|
||||
style={{ zIndex: 0, aspectRatio: 1, borderRadius: CardBorderRadius }}
|
||||
source={{ uri: image }}
|
||||
source={{ uri: API.getArtistIllustration(id) }}
|
||||
alt={name}
|
||||
/>
|
||||
<VStack>
|
||||
@@ -31,13 +29,13 @@ const ArtistCard = (props: ArtistCardProps) => {
|
||||
</VStack>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
ArtistCard.defaultProps = {
|
||||
image: 'https://picsum.photos/200',
|
||||
name: 'Artist',
|
||||
image: "https://picsum.photos/200",
|
||||
name: "Artist",
|
||||
id: 0,
|
||||
onPress: () => { }
|
||||
}
|
||||
onPress: () => { },
|
||||
};
|
||||
|
||||
export default ArtistCard;
|
||||
export default ArtistCard;
|
||||
|
||||
Reference in New Issue
Block a user