feat: artist illustrations

This commit is contained in:
GitBluub
2023-05-30 02:34:05 +09:00
committed by Clément Le Bihan
parent 7f51582043
commit 3553954afd
29 changed files with 20 additions and 19 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1012 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

View File

@@ -296,17 +296,20 @@ export default class API {
});
}
/**
* Retrive a song's midi partition
* @param songId the id to find the song
*/
public static getArtistIllustration(artistId: number): string {
return `${baseAPIUrl}/artist/${artistId}/illustration`;
}
/**
* Retrive a song's midi partition
* @param songId the id to find the song
*/
public static getGenreIllustration(genreId: number): string {
return `${baseAPIUrl}/genre/${genreId}/illustration`;
/*
return API.fetch({
route: `/genre/${genreId}/illustration`,
raw: true,
});*/
}
/**

View File

@@ -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;