板球直播详情基本信息
This commit is contained in:
@@ -14,6 +14,13 @@ export function CricketTeamsCard({ data, isDark }: CricketTeamsCardProps) {
|
||||
const { t } = useTranslation();
|
||||
const { match } = data;
|
||||
|
||||
// Basic parsing for cricket scores from string "Score1 - Score2"
|
||||
const scores = match.eventFinalResult
|
||||
? match.eventFinalResult.split("-")
|
||||
: [];
|
||||
const homeScore = scores[0]?.trim();
|
||||
const awayScore = scores[1]?.trim();
|
||||
|
||||
return (
|
||||
<ThemedView
|
||||
style={[
|
||||
@@ -28,24 +35,38 @@ export function CricketTeamsCard({ data, isDark }: CricketTeamsCardProps) {
|
||||
<View style={styles.content}>
|
||||
{/* Home Team */}
|
||||
<View style={styles.teamRow}>
|
||||
<Image
|
||||
source={{ uri: match.homeTeamLogo }}
|
||||
style={styles.logo}
|
||||
resizeMode="contain"
|
||||
/>
|
||||
<ThemedText style={styles.teamName}>{match.eventHomeTeam}</ThemedText>
|
||||
<View style={styles.teamInfo}>
|
||||
<Image
|
||||
source={{ uri: match.homeTeamLogo }}
|
||||
style={styles.logo}
|
||||
resizeMode="contain"
|
||||
/>
|
||||
<ThemedText style={styles.teamName}>
|
||||
{match.eventHomeTeam}
|
||||
</ThemedText>
|
||||
</View>
|
||||
{homeScore ? (
|
||||
<ThemedText style={styles.scoreText}>{homeScore}</ThemedText>
|
||||
) : null}
|
||||
</View>
|
||||
|
||||
<View style={styles.divider} />
|
||||
|
||||
{/* Away Team */}
|
||||
<View style={styles.teamRow}>
|
||||
<Image
|
||||
source={{ uri: match.awayTeamLogo }}
|
||||
style={styles.logo}
|
||||
resizeMode="contain"
|
||||
/>
|
||||
<ThemedText style={styles.teamName}>{match.eventAwayTeam}</ThemedText>
|
||||
<View style={styles.teamInfo}>
|
||||
<Image
|
||||
source={{ uri: match.awayTeamLogo }}
|
||||
style={styles.logo}
|
||||
resizeMode="contain"
|
||||
/>
|
||||
<ThemedText style={styles.teamName}>
|
||||
{match.eventAwayTeam}
|
||||
</ThemedText>
|
||||
</View>
|
||||
{awayScore ? (
|
||||
<ThemedText style={styles.scoreText}>{awayScore}</ThemedText>
|
||||
) : null}
|
||||
</View>
|
||||
</View>
|
||||
</ThemedView>
|
||||
@@ -74,8 +95,14 @@ const styles = StyleSheet.create({
|
||||
teamRow: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "space-between",
|
||||
paddingVertical: 8,
|
||||
},
|
||||
teamInfo: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
flex: 1,
|
||||
},
|
||||
logo: {
|
||||
width: 32,
|
||||
height: 32,
|
||||
@@ -84,6 +111,13 @@ const styles = StyleSheet.create({
|
||||
teamName: {
|
||||
fontSize: 16,
|
||||
fontWeight: "500",
|
||||
flexShrink: 1,
|
||||
},
|
||||
scoreText: {
|
||||
fontSize: 16,
|
||||
color: "#2196F3",
|
||||
fontWeight: "bold",
|
||||
marginLeft: 8,
|
||||
},
|
||||
divider: {
|
||||
height: 1,
|
||||
|
||||
Reference in New Issue
Block a user