Fixed number of lignes on DiscoveryCard

This commit is contained in:
Clément Le Bihan
2023-12-19 16:31:03 +01:00
parent 9df0c98100
commit b4f04f9b71
2 changed files with 4 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ const GoldenRatio = (props: GoldenRatioProps) => {
>
<GoldenRatioPanel
direction={isPhone ? 'row-reverse' : 'column-reverse'}
header={<HomeMainSongCard {...cards[3]!} />}
header={<HomeMainSongCard numLinesHeader={1} {...cards[3]!} />}
>
<View style={{ display: 'flex', width: '100%', height: '100%' }}></View>
</GoldenRatioPanel>

View File

@@ -6,6 +6,7 @@ type HomeMainSongCardProps = {
title: string;
artist: string;
fontSize: number;
numLinesHeader: number;
onPress: () => void;
};
@@ -66,7 +67,7 @@ const HomeMainSongCard = (props: HomeMainSongCardProps) => {
fontSize: props.fontSize,
fontWeight: 'bold',
}}
numberOfLines={2}
numberOfLines={props.numLinesHeader}
selectable={false}
>
{props.title}
@@ -94,6 +95,7 @@ const HomeMainSongCard = (props: HomeMainSongCardProps) => {
HomeMainSongCard.defaultProps = {
onPress: () => {},
fontSize: 16,
numLinesHeader: 2,
};
export default HomeMainSongCard;