Feature/adc/#192 barre de recherche (#201)
* context and react query add to searchView * handle empty result + back * #192 - New card components and history fetch + dummy suggestions fetch * respoonsive design + filters map * artist details view + translations + SongData mapping fix + items limitation * history search back and front + cards + fix * fixed useless history entries * clean code * clean code * fix pr: SearchHistory new type related fixes * simplified SearchResultComponent (useEffect removed, condition simplified to trigger different 'modes' * search re-do onPress history cards + scoreView obj map * clean code API.ts * fix pr + search history behavior * added utility function to get song suggestions with artists and fixed error types along the way * fix in songrow the title didn't shrinked when not enough space on screen * removed redirect callback from ArtistCard to ArtistResults * moved the callback from genre card grid to searchresult and implemented history for songs * SearchBar is now updating input search following stringQuery * added scroll view to have the complete background * Added the route props for query in Searchview * fixed robot test --------- Co-authored-by: Clément Le Bihan <clement.lebihan773@gmail.com>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import React from "react";
|
||||
import Card, { CardBorderRadius } from './Card';
|
||||
import { VStack, Text, Image } from 'native-base';
|
||||
|
||||
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}
|
||||
>
|
||||
<VStack m={1.5} space={3}>
|
||||
<Image
|
||||
style={{ zIndex: 0, aspectRatio: 1, borderRadius: CardBorderRadius }}
|
||||
source={{ uri: image }}
|
||||
alt={name}
|
||||
/>
|
||||
<VStack>
|
||||
<Text isTruncated bold fontSize="md" noOfLines={2} height={50}>
|
||||
{name}
|
||||
</Text>
|
||||
</VStack>
|
||||
</VStack>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
ArtistCard.defaultProps = {
|
||||
image: 'https://picsum.photos/200',
|
||||
name: 'Artist',
|
||||
id: 0,
|
||||
onPress: () => { }
|
||||
}
|
||||
|
||||
export default ArtistCard;
|
||||
Reference in New Issue
Block a user