Added specific fontSizes for each card

This commit is contained in:
Clément Le Bihan
2023-09-20 11:52:03 +02:00
parent 6e3e73982f
commit 5b7cb6746d
3 changed files with 10 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ type HomeMainSongCardProps = {
image: string;
title: string;
artist: string;
fontSize: number;
onPress: () => void;
};
@@ -61,7 +62,7 @@ const HomeMainSongCard = (props: HomeMainSongCardProps) => {
<Text
style={{
color: 'white',
fontSize: 46,
fontSize: props.fontSize,
fontWeight: 'bold',
}}
selectable={false}
@@ -71,7 +72,7 @@ const HomeMainSongCard = (props: HomeMainSongCardProps) => {
<Text
style={{
color: 'white',
fontSize: 16,
fontSize: props.fontSize * 0.4,
fontWeight: 'bold',
textAlign: 'center',
}}
@@ -89,6 +90,7 @@ const HomeMainSongCard = (props: HomeMainSongCardProps) => {
HomeMainSongCard.defaultProps = {
onPress: () => {},
fontSize: 16,
};
export default HomeMainSongCard;

View File

@@ -1,7 +1,7 @@
import Song from '../../models/Song';
import React from 'react';
import { Image, View } from 'react-native';
import { Pressable, Text, PresenceTransition, Icon, Button } from 'native-base';
import { Pressable, Text, PresenceTransition, Icon } from 'native-base';
import { Ionicons } from '@expo/vector-icons';
type SongCardInfoProps = {

View File

@@ -14,6 +14,7 @@ type HomeCardProps = {
image: string;
title: string;
artist: string;
fontSize: number;
};
const cards = [
@@ -21,21 +22,25 @@ const cards = [
image: 'https://media.discordapp.net/attachments/717080637038788731/1153688155292180560/image_homeview1.png',
title: 'Beethoven',
artist: 'Synphony No. 9',
fontSize: 46,
},
{
image: 'https://media.discordapp.net/attachments/717080637038788731/1153688154923090093/image_homeview2.png',
title: 'Mozart',
artist: 'Lieder Kantate KV 619',
fontSize: 36,
},
{
image: 'https://media.discordapp.net/attachments/717080637038788731/1153688154499457096/image_homeview3.png',
title: 'Back',
artist: 'Truc Truc',
fontSize: 26,
},
{
image: 'https://media.discordapp.net/attachments/717080637038788731/1153688154109394985/image_homeview4.png',
title: 'Mozart',
artist: 'Machin Machin',
fontSize: 22,
},
] as [HomeCardProps, HomeCardProps, HomeCardProps, HomeCardProps];