Front: Use history include to get best/last score for a song

This commit is contained in:
Arthur Jamet
2023-12-19 11:13:25 +01:00
committed by Clément Le Bihan
parent b4f04f9b71
commit 7a6dc8b0c9
7 changed files with 38 additions and 35 deletions
+12 -15
View File
@@ -10,21 +10,6 @@ type SongCardInfoProps = {
onPlay: () => void;
};
const Scores = [
{
icon: 'warning',
score: 3,
},
{
icon: 'star',
score: -225,
},
{
icon: 'trophy',
score: 100,
},
];
const SongCardInfo = (props: SongCardInfoProps) => {
const screenSize = useBreakpointValue({ base: 'small', md: 'big' });
const isPhone = screenSize === 'small';
@@ -37,6 +22,18 @@ const SongCardInfo = (props: SongCardInfoProps) => {
width: isPhone ? 160 : 200,
};
const Scores = [
{
icon: 'time',
score: props.song.lastScore ?? '?',
},
{
icon: 'trophy',
score: props.song.bestScore ?? '?',
},
];
return (
<View
style={{