import React from 'react'; import { StyleSheet, View } from 'react-native'; import { Text, useTheme } from 'react-native-paper'; import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'; import * as Animatable from 'react-native-animatable'; type Props = { place: 1 | 2 | 3; score: string; isHighScore: boolean; }; const styles = StyleSheet.create({ podiumContainer: { flexDirection: 'column', alignItems: 'center', justifyContent: 'flex-end', }, podiumIconContainer: { position: 'absolute', top: -20, }, centertext: { textAlign: 'center', }, }); export function GamePodium(props: Props) { const { place, score, isHighScore } = props; const theme = useTheme(); let icon = 'podium-gold'; let color = theme.colors.gameGold; let fontSize = 20; let size = 70; if (place === 2) { icon = 'podium-silver'; color = theme.colors.gameSilver; fontSize = 18; size = 60; } else if (place === 3) { icon = 'podium-bronze'; color = theme.colors.gameBronze; fontSize = 15; size = 50; } const marginLeft = place === 2 ? 20 : 'auto'; const marginRight = place === 3 ? 20 : 'auto'; const fontWeight = place === 1 ? 'bold' : undefined; return ( {isHighScore && place === 1 ? ( ) : null} {score} ); }