Merge branch 'main' of https://git.ambigrat.com/shenyan/physical-expo
This commit is contained in:
34
components/empty-placeholder.tsx
Normal file
34
components/empty-placeholder.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import { useTheme } from "@/context/ThemeContext";
|
||||
import { Image } from "expo-image";
|
||||
import React from "react";
|
||||
|
||||
interface EmptyPlaceholderProps {
|
||||
type: "team" | "league" | "player" | "country";
|
||||
size?: number;
|
||||
}
|
||||
|
||||
const imageMap: { [key: string]: any } = {
|
||||
team_light: require("@/assets/empty/team_light.svg"),
|
||||
team_dark: require("@/assets/empty/team_dark.svg"),
|
||||
league_light: require("@/assets/empty/league_light.svg"),
|
||||
league_dark: require("@/assets/empty/league_dark.svg"),
|
||||
player_light: require("@/assets/empty/player_light.svg"),
|
||||
player_dark: require("@/assets/empty/player_dark.svg"),
|
||||
country_light: require("@/assets/empty/country_light.svg"),
|
||||
country_dark: require("@/assets/empty/country_dark.svg"),
|
||||
};
|
||||
|
||||
export function EmptyPlaceholder({ type, size = 64 }: EmptyPlaceholderProps) {
|
||||
const { theme } = useTheme();
|
||||
const isDark = theme === "dark";
|
||||
const suffix = isDark ? "_dark" : "_light";
|
||||
const imageKey = `${type}${suffix}`;
|
||||
|
||||
return (
|
||||
<Image
|
||||
source={imageMap[imageKey] || imageMap.team_light}
|
||||
style={{ width: size, height: size }}
|
||||
contentFit="contain"
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { EmptyPlaceholder } from "@/components/empty-placeholder";
|
||||
import { ThemedText } from "@/components/themed-text";
|
||||
import { IconSymbol } from "@/components/ui/icon-symbol";
|
||||
import { Colors } from "@/constants/theme";
|
||||
@@ -47,14 +48,14 @@ export function LeagueModal({
|
||||
>
|
||||
{/* 左侧图标 */}
|
||||
<View style={[styles.iconContainer, { backgroundColor: iconBg }]}>
|
||||
{league.logo ? (
|
||||
{league.logo && league.logo.trim() !== "" && !league.logo.includes("placehold") ? (
|
||||
<Image
|
||||
source={{ uri: league.logo }}
|
||||
style={styles.leagueLogo}
|
||||
contentFit="contain"
|
||||
/>
|
||||
) : (
|
||||
<IconSymbol name="trophy-outline" size={24} color={text} />
|
||||
<EmptyPlaceholder type="league" size={24} />
|
||||
)}
|
||||
</View>
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { EmptyPlaceholder } from "@/components/empty-placeholder";
|
||||
import { ThemedText } from "@/components/themed-text";
|
||||
import { IconSymbol } from "@/components/ui/icon-symbol";
|
||||
import { LiveScoreMatch } from "@/types/api";
|
||||
@@ -23,15 +24,13 @@ export function LiveLeagueInfo({ match }: LiveLeagueInfoProps) {
|
||||
activeOpacity={0.7}
|
||||
>
|
||||
<View style={styles.left}>
|
||||
{match.league_logo ? (
|
||||
{match.league_logo && match.league_logo.trim() !== "" && !match.league_logo.includes("placehold") ? (
|
||||
<Image
|
||||
source={{ uri: match.league_logo }}
|
||||
style={styles.leagueLogo}
|
||||
/>
|
||||
) : (
|
||||
<View style={[styles.fallbackLogo, { backgroundColor: "#333" }]}>
|
||||
<IconSymbol name="trophy-outline" size={14} color="#AAA" />
|
||||
</View>
|
||||
<EmptyPlaceholder type="league" size={24} />
|
||||
)}
|
||||
<ThemedText style={[styles.leagueName, { color: textColor }]}>
|
||||
{match.league_name}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { EmptyPlaceholder } from "@/components/empty-placeholder";
|
||||
import { ThemedText } from "@/components/themed-text";
|
||||
import { IconSymbol } from "@/components/ui/icon-symbol";
|
||||
import { addFavorite, checkFavorite, removeFavorite } from "@/lib/api";
|
||||
@@ -265,10 +266,14 @@ export function LiveScoreHeader({ match, topInset }: LiveScoreHeaderProps) {
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
<View style={styles.logoContainer}>
|
||||
<Image
|
||||
source={{ uri: homeLogo }}
|
||||
style={[styles.teamLogo, isTennis && styles.tennisAvatar]}
|
||||
/>
|
||||
{homeLogo && homeLogo.trim() !== "" && !homeLogo.includes("placehold") ? (
|
||||
<Image
|
||||
source={{ uri: homeLogo }}
|
||||
style={[styles.teamLogo, isTennis && styles.tennisAvatar]}
|
||||
/>
|
||||
) : (
|
||||
<EmptyPlaceholder type={isTennis ? "player" : "team"} size={60} />
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
<ThemedText style={styles.teamName} numberOfLines={2}>
|
||||
@@ -318,10 +323,14 @@ export function LiveScoreHeader({ match, topInset }: LiveScoreHeaderProps) {
|
||||
<View style={styles.teamInfo}>
|
||||
<View style={styles.teamLogoRow}>
|
||||
<View style={styles.logoContainer}>
|
||||
<Image
|
||||
source={{ uri: awayLogo }}
|
||||
style={[styles.teamLogo, isTennis && styles.tennisAvatar]}
|
||||
/>
|
||||
{awayLogo && awayLogo.trim() !== "" && !awayLogo.includes("placehold") ? (
|
||||
<Image
|
||||
source={{ uri: awayLogo }}
|
||||
style={[styles.teamLogo, isTennis && styles.tennisAvatar]}
|
||||
/>
|
||||
) : (
|
||||
<EmptyPlaceholder type={isTennis ? "player" : "team"} size={60} />
|
||||
)}
|
||||
</View>
|
||||
<TouchableOpacity
|
||||
onPress={() => toggleTeamFavorite(match.away_team_key, false)}
|
||||
@@ -437,7 +446,7 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
scoreValue: {
|
||||
color: "#000",
|
||||
fontSize: 25,
|
||||
fontSize: 20,
|
||||
fontWeight: "700",
|
||||
lineHeight: 30,
|
||||
letterSpacing: 1,
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import { EmptyPlaceholder } from "@/components/empty-placeholder";
|
||||
import { ThemedText } from "@/components/themed-text";
|
||||
import { IconSymbol } from "@/components/ui/icon-symbol";
|
||||
import { Colors } from "@/constants/theme";
|
||||
import { useAppState } from "@/context/AppStateContext";
|
||||
import { useTheme } from "@/context/ThemeContext";
|
||||
import { addFavorite, removeFavorite } from "@/lib/api";
|
||||
import { getInitials, getLogoGradient } from "@/lib/avatar-utils";
|
||||
import { Match } from "@/types/api";
|
||||
import { LinearGradient } from "expo-linear-gradient";
|
||||
import { useRouter } from "expo-router";
|
||||
import React, { useState } from "react";
|
||||
import { Image, Pressable, StyleSheet, TouchableOpacity, View } from "react-native";
|
||||
@@ -182,13 +181,10 @@ export function MatchCardLeague({
|
||||
<View style={styles.teamsColumn}>
|
||||
<View style={styles.teamRow}>
|
||||
{(() => {
|
||||
const teamName = isTennis ? (match as any).eventFirstPlayer : (match.home || match.homeTeamName);
|
||||
const logoUri = isTennis
|
||||
? (match as any).eventFirstPlayerLogo
|
||||
: ((match as any).homeLogo || match.homeTeamLogo);
|
||||
const hasLogo = logoUri && logoUri.trim() !== "" && !logoUri.includes("placehold");
|
||||
const gradient = getLogoGradient(teamName || "");
|
||||
const initials = getInitials(teamName || "");
|
||||
|
||||
return hasLogo ? (
|
||||
<Image
|
||||
@@ -196,14 +192,7 @@ export function MatchCardLeague({
|
||||
style={styles.teamLogo}
|
||||
/>
|
||||
) : (
|
||||
<LinearGradient
|
||||
colors={[gradient.color1, gradient.color2]}
|
||||
start={{ x: 0, y: 0 }}
|
||||
end={{ x: 1, y: 1 }}
|
||||
style={styles.teamLogoGradient}
|
||||
>
|
||||
<ThemedText style={styles.teamLogoText}>{initials}</ThemedText>
|
||||
</LinearGradient>
|
||||
<EmptyPlaceholder type="team" size={24} />
|
||||
);
|
||||
})()}
|
||||
<View style={styles.teamNameContainer}>
|
||||
@@ -217,13 +206,10 @@ export function MatchCardLeague({
|
||||
|
||||
<View style={[styles.teamRow, { marginTop: 10 }]}>
|
||||
{(() => {
|
||||
const teamName = isTennis ? (match as any).eventSecondPlayer : (match.away || match.awayTeamName);
|
||||
const logoUri = isTennis
|
||||
? (match as any).eventSecondPlayerLogo
|
||||
: ((match as any).awayLogo || match.awayTeamLogo);
|
||||
const hasLogo = logoUri && logoUri.trim() !== "" && !logoUri.includes("placehold");
|
||||
const gradient = getLogoGradient(teamName || "");
|
||||
const initials = getInitials(teamName || "");
|
||||
|
||||
return hasLogo ? (
|
||||
<Image
|
||||
@@ -231,14 +217,7 @@ export function MatchCardLeague({
|
||||
style={styles.teamLogo}
|
||||
/>
|
||||
) : (
|
||||
<LinearGradient
|
||||
colors={[gradient.color1, gradient.color2]}
|
||||
start={{ x: 0, y: 0 }}
|
||||
end={{ x: 1, y: 1 }}
|
||||
style={styles.teamLogoGradient}
|
||||
>
|
||||
<ThemedText style={styles.teamLogoText}>{initials}</ThemedText>
|
||||
</LinearGradient>
|
||||
<EmptyPlaceholder type="team" size={24} />
|
||||
);
|
||||
})()}
|
||||
<View style={styles.teamNameContainer}>
|
||||
@@ -386,7 +365,7 @@ const styles = StyleSheet.create({
|
||||
gap: 6,
|
||||
},
|
||||
scoreBox: {
|
||||
width: 36,
|
||||
width: 45,
|
||||
height: 54,
|
||||
borderRadius: 8,
|
||||
borderWidth: 1.5,
|
||||
@@ -416,7 +395,7 @@ const styles = StyleSheet.create({
|
||||
color: "#FF9500",
|
||||
},
|
||||
scoreBoxPlaceholder: {
|
||||
width: 36,
|
||||
width: 45,
|
||||
height: 54,
|
||||
},
|
||||
favoriteButton: {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { EmptyPlaceholder } from "@/components/empty-placeholder";
|
||||
import { ThemedText } from "@/components/themed-text";
|
||||
import { IconSymbol } from "@/components/ui/icon-symbol";
|
||||
import { Colors } from "@/constants/theme";
|
||||
@@ -467,13 +468,16 @@ export function MatchCard({
|
||||
<View style={styles.contentRow}>
|
||||
<View style={styles.teamInfo}>
|
||||
<View style={styles.teamLogoPlaceholder}>
|
||||
<Image
|
||||
source={{
|
||||
uri: homeLogo,
|
||||
}}
|
||||
style={styles.teamLogo}
|
||||
contentFit="contain"
|
||||
/>
|
||||
{homeLogo && homeLogo.trim() !== "" && !homeLogo.includes("placehold") ? (
|
||||
<Image
|
||||
source={{ uri: homeLogo }}
|
||||
style={styles.teamLogo}
|
||||
contentFit="contain"
|
||||
onError={() => {}}
|
||||
/>
|
||||
) : (
|
||||
<EmptyPlaceholder type="team" size={18} />
|
||||
)}
|
||||
</View>
|
||||
<ThemedText
|
||||
type="defaultSemiBold"
|
||||
@@ -492,13 +496,16 @@ export function MatchCard({
|
||||
<View style={styles.contentRow}>
|
||||
<View style={styles.teamInfo}>
|
||||
<View style={styles.teamLogoPlaceholder}>
|
||||
<Image
|
||||
source={{
|
||||
uri: awayLogo,
|
||||
}}
|
||||
style={styles.teamLogo}
|
||||
contentFit="contain"
|
||||
/>
|
||||
{awayLogo && awayLogo.trim() !== "" && !awayLogo.includes("placehold") ? (
|
||||
<Image
|
||||
source={{ uri: awayLogo }}
|
||||
style={styles.teamLogo}
|
||||
contentFit="contain"
|
||||
onError={() => {}}
|
||||
/>
|
||||
) : (
|
||||
<EmptyPlaceholder type="team" size={18} />
|
||||
)}
|
||||
</View>
|
||||
<ThemedText
|
||||
type="defaultSemiBold"
|
||||
@@ -709,7 +716,7 @@ const styles = StyleSheet.create({
|
||||
alignItems: "center",
|
||||
},
|
||||
scoreContainer: {
|
||||
width: 25,
|
||||
width: 35,
|
||||
alignItems: "center",
|
||||
},
|
||||
extraStatsContainer: {
|
||||
@@ -722,7 +729,7 @@ const styles = StyleSheet.create({
|
||||
alignItems: "center",
|
||||
},
|
||||
scoreBox: {
|
||||
width: 28,
|
||||
width: 35,
|
||||
height: 55,
|
||||
borderRadius: 8,
|
||||
borderWidth: 0.3,
|
||||
@@ -751,7 +758,7 @@ const styles = StyleSheet.create({
|
||||
backgroundColor: "rgba(0,0,0,0.06)",
|
||||
},
|
||||
scoreBoxPlaceholder: {
|
||||
width: 28,
|
||||
width: 35,
|
||||
height: 48,
|
||||
},
|
||||
cardsInline: {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { EmptyPlaceholder } from "@/components/empty-placeholder";
|
||||
import { ThemedText } from "@/components/themed-text";
|
||||
import { MatchDetailData } from "@/types/api";
|
||||
import React from "react";
|
||||
@@ -143,7 +144,9 @@ export function BasketballScoreTable({
|
||||
<View style={styles.teamCell}>
|
||||
{row.logo && row.logo.trim() !== "" && !row.logo.includes("placehold") ? (
|
||||
<Image source={{ uri: row.logo }} style={styles.teamLogo} />
|
||||
) : null}
|
||||
) : (
|
||||
<EmptyPlaceholder type="team" size={28} />
|
||||
)}
|
||||
<ThemedText style={[styles.teamName, { color: textColor }]} numberOfLines={1}>
|
||||
{row.name}
|
||||
</ThemedText>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { EmptyPlaceholder } from "@/components/empty-placeholder";
|
||||
import { ThemedText } from "@/components/themed-text";
|
||||
import { IconSymbol } from "@/components/ui/icon-symbol";
|
||||
import { getInitials, getLogoGradient } from "@/lib/avatar-utils";
|
||||
import { MatchDetailData } from "@/types/api";
|
||||
import { Image } from "expo-image";
|
||||
import { LinearGradient } from "expo-linear-gradient";
|
||||
import React, { useMemo, useState } from "react";
|
||||
import {
|
||||
ScrollView,
|
||||
@@ -161,10 +160,6 @@ export function BasketballStats({ data, isDark }: BasketballStatsProps) {
|
||||
const awayTeamLogo = match.awayTeamLogo || "";
|
||||
const hasHomeLogo = homeTeamLogo && homeTeamLogo.trim() !== "" && !homeTeamLogo.includes("placehold");
|
||||
const hasAwayLogo = awayTeamLogo && awayTeamLogo.trim() !== "" && !awayTeamLogo.includes("placehold");
|
||||
const homeGradient = getLogoGradient(homeTeamName);
|
||||
const awayGradient = getLogoGradient(awayTeamName);
|
||||
const homeInitials = getInitials(homeTeamName);
|
||||
const awayInitials = getInitials(awayTeamName);
|
||||
|
||||
return (
|
||||
<View style={[styles.container, { backgroundColor: bgColor }]}>
|
||||
@@ -199,12 +194,7 @@ export function BasketballStats({ data, isDark }: BasketballStatsProps) {
|
||||
{hasHomeLogo ? (
|
||||
<Image source={{ uri: homeTeamLogo }} style={styles.teamTabLogo} contentFit="contain" />
|
||||
) : (
|
||||
<LinearGradient
|
||||
colors={[homeGradient.color1, homeGradient.color2]}
|
||||
style={styles.teamTabLogoGradient}
|
||||
>
|
||||
<ThemedText style={styles.teamTabLogoText}>{homeInitials}</ThemedText>
|
||||
</LinearGradient>
|
||||
<EmptyPlaceholder type="team" size={24} />
|
||||
)}
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity
|
||||
@@ -218,12 +208,7 @@ export function BasketballStats({ data, isDark }: BasketballStatsProps) {
|
||||
{hasAwayLogo ? (
|
||||
<Image source={{ uri: awayTeamLogo }} style={styles.teamTabLogo} contentFit="contain" />
|
||||
) : (
|
||||
<LinearGradient
|
||||
colors={[awayGradient.color1, awayGradient.color2]}
|
||||
style={styles.teamTabLogoGradient}
|
||||
>
|
||||
<ThemedText style={styles.teamTabLogoText}>{awayInitials}</ThemedText>
|
||||
</LinearGradient>
|
||||
<EmptyPlaceholder type="team" size={24} />
|
||||
)}
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { EmptyPlaceholder } from "@/components/empty-placeholder";
|
||||
import { ThemedText } from "@/components/themed-text";
|
||||
import { MatchDetailData } from "@/types/api";
|
||||
import React from "react";
|
||||
@@ -89,7 +90,11 @@ export function FootballScoreTable({ data, isDark }: FootballScoreTableProps) {
|
||||
{rows.map((row, idx) => (
|
||||
<View key={idx} style={[styles.row, idx === 0 && styles.rowBorder]}>
|
||||
<View style={styles.teamCell}>
|
||||
<Image source={{ uri: row.logo }} style={styles.teamLogo} />
|
||||
{row.logo && row.logo.trim() !== "" && !row.logo.includes("placehold") ? (
|
||||
<Image source={{ uri: row.logo }} style={styles.teamLogo} />
|
||||
) : (
|
||||
<EmptyPlaceholder type="team" size={28} />
|
||||
)}
|
||||
<ThemedText style={styles.teamName} numberOfLines={1}>
|
||||
{row.name}
|
||||
</ThemedText>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { EmptyPlaceholder } from "@/components/empty-placeholder";
|
||||
import { ThemedText } from "@/components/themed-text";
|
||||
import { IconSymbol } from "@/components/ui/icon-symbol";
|
||||
import { MatchDetailData } from "@/types/api";
|
||||
@@ -25,12 +26,10 @@ export function LeagueInfo({ data, isDark }: LeagueInfoProps) {
|
||||
activeOpacity={0.7}
|
||||
>
|
||||
<View style={styles.left}>
|
||||
{match.leagueLogo ? (
|
||||
{match.leagueLogo && match.leagueLogo.trim() !== "" && !match.leagueLogo.includes("placehold") ? (
|
||||
<Image source={{ uri: match.leagueLogo }} style={styles.leagueLogo} />
|
||||
) : (
|
||||
<View style={[styles.fallbackLogo, { backgroundColor: "#333" }]}>
|
||||
<IconSymbol name="trophy-outline" size={14} color="#AAA" />
|
||||
</View>
|
||||
<EmptyPlaceholder type="league" size={24} />
|
||||
)}
|
||||
<ThemedText style={[styles.leagueName, { color: textColor }]}>
|
||||
{match.leagueName}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { EmptyPlaceholder } from "@/components/empty-placeholder";
|
||||
import { ThemedText } from "@/components/themed-text";
|
||||
import { IconSymbol } from "@/components/ui/icon-symbol";
|
||||
import { addFavorite, checkFavorite, removeFavorite } from "@/lib/api";
|
||||
import { getInitials, getLogoGradient } from "@/lib/avatar-utils";
|
||||
import { storage } from "@/lib/storage";
|
||||
import { MatchDetailData } from "@/types/api";
|
||||
import { LinearGradient } from "expo-linear-gradient";
|
||||
@@ -170,10 +170,6 @@ export function ScoreHeader({ data, isDark, topInset }: ScoreHeaderProps) {
|
||||
|
||||
const hasFirstLogo = firstPlayerLogo && firstPlayerLogo.trim() !== "" && !firstPlayerLogo.includes("placehold");
|
||||
const hasSecondLogo = secondPlayerLogo && secondPlayerLogo.trim() !== "" && !secondPlayerLogo.includes("placehold");
|
||||
const firstGradient = getLogoGradient(firstPlayerName || "");
|
||||
const secondGradient = getLogoGradient(secondPlayerName || "");
|
||||
const firstInitials = getInitials(firstPlayerName || "");
|
||||
const secondInitials = getInitials(secondPlayerName || "");
|
||||
|
||||
return (
|
||||
<LinearGradient
|
||||
@@ -243,14 +239,7 @@ export function ScoreHeader({ data, isDark, topInset }: ScoreHeaderProps) {
|
||||
style={styles.teamLogo}
|
||||
/>
|
||||
) : (
|
||||
<LinearGradient
|
||||
colors={[firstGradient.color1, firstGradient.color2]}
|
||||
start={{ x: 0, y: 0 }}
|
||||
end={{ x: 1, y: 1 }}
|
||||
style={styles.teamLogoGradient}
|
||||
>
|
||||
<ThemedText style={styles.teamLogoText}>{firstInitials}</ThemedText>
|
||||
</LinearGradient>
|
||||
<EmptyPlaceholder type={isTennis ? "player" : "team"} size={60} />
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
@@ -283,14 +272,7 @@ export function ScoreHeader({ data, isDark, topInset }: ScoreHeaderProps) {
|
||||
style={styles.teamLogo}
|
||||
/>
|
||||
) : (
|
||||
<LinearGradient
|
||||
colors={[secondGradient.color1, secondGradient.color2]}
|
||||
start={{ x: 0, y: 0 }}
|
||||
end={{ x: 1, y: 1 }}
|
||||
style={styles.teamLogoGradient}
|
||||
>
|
||||
<ThemedText style={styles.teamLogoText}>{secondInitials}</ThemedText>
|
||||
</LinearGradient>
|
||||
<EmptyPlaceholder type={isTennis ? "player" : "team"} size={60} />
|
||||
)}
|
||||
</View>
|
||||
<TouchableOpacity
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import { EmptyPlaceholder } from "@/components/empty-placeholder";
|
||||
import { MatchCardLeague } from "@/components/match-card-league";
|
||||
import { ThemedText } from "@/components/themed-text";
|
||||
import { Colors } from "@/constants/theme";
|
||||
import { useTheme } from "@/context/ThemeContext";
|
||||
import { fetchLeagues, fetchTodayMatches } from "@/lib/api";
|
||||
import { getInitials, getLogoGradient } from "@/lib/avatar-utils";
|
||||
import { League, Match } from "@/types/api";
|
||||
import { Image } from "expo-image";
|
||||
import { LinearGradient } from "expo-linear-gradient";
|
||||
import React, { useState } from "react";
|
||||
import {
|
||||
ActivityIndicator,
|
||||
@@ -212,8 +211,6 @@ export function MatchesByLeague({
|
||||
<View style={styles.leagueHeaderLeft}>
|
||||
{(() => {
|
||||
const hasLogo = league.logo && league.logo.trim() !== "" && !league.logo.includes("placehold");
|
||||
const gradient = getLogoGradient(league.name || "");
|
||||
const initials = getInitials(league.name || "");
|
||||
|
||||
return hasLogo ? (
|
||||
<Image
|
||||
@@ -221,14 +218,7 @@ export function MatchesByLeague({
|
||||
style={[styles.leagueLogo, { backgroundColor: isDark ? "#3A3A3C" : "#E5E5E5" }]}
|
||||
/>
|
||||
) : (
|
||||
<LinearGradient
|
||||
colors={[gradient.color1, gradient.color2]}
|
||||
start={{ x: 0, y: 0 }}
|
||||
end={{ x: 1, y: 1 }}
|
||||
style={styles.leagueLogoGradient}
|
||||
>
|
||||
<ThemedText style={styles.leagueLogoText}>{initials}</ThemedText>
|
||||
</LinearGradient>
|
||||
<EmptyPlaceholder type="league" size={32} />
|
||||
);
|
||||
})()}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { EmptyPlaceholder } from "@/components/empty-placeholder";
|
||||
import { ThemedText } from "@/components/themed-text";
|
||||
import { IconSymbol } from "@/components/ui/icon-symbol";
|
||||
import { Colors } from "@/constants/theme";
|
||||
@@ -122,12 +123,14 @@ export function UpcomingMatchCard({
|
||||
|
||||
<View style={styles.teamsContainer}>
|
||||
<View style={styles.team}>
|
||||
{match.homeTeamLogo && (
|
||||
{match.homeTeamLogo && match.homeTeamLogo.trim() !== "" && !match.homeTeamLogo.includes("placehold") ? (
|
||||
<Image
|
||||
source={{ uri: match.homeTeamLogo }}
|
||||
style={styles.teamLogo}
|
||||
contentFit="contain"
|
||||
/>
|
||||
) : (
|
||||
<EmptyPlaceholder type="team" size={24} />
|
||||
)}
|
||||
<ThemedText
|
||||
type="defaultSemiBold"
|
||||
@@ -143,12 +146,14 @@ export function UpcomingMatchCard({
|
||||
</View>
|
||||
|
||||
<View style={styles.team}>
|
||||
{match.awayTeamLogo && (
|
||||
{match.awayTeamLogo && match.awayTeamLogo.trim() !== "" && !match.awayTeamLogo.includes("placehold") ? (
|
||||
<Image
|
||||
source={{ uri: match.awayTeamLogo }}
|
||||
style={styles.teamLogo}
|
||||
contentFit="contain"
|
||||
/>
|
||||
) : (
|
||||
<EmptyPlaceholder type="team" size={24} />
|
||||
)}
|
||||
<ThemedText
|
||||
type="defaultSemiBold"
|
||||
|
||||
Reference in New Issue
Block a user