This commit is contained in:
yuchenglong
2026-01-23 16:54:29 +08:00
33 changed files with 218 additions and 206 deletions

View File

@@ -390,7 +390,7 @@ export default function HomeScreen() {
awayTeamName: item.event_away_team,
homeTeamLogo: item.home_team_logo || "",
awayTeamLogo: item.away_team_logo || "",
scoreText: item.event_halftime_result || "0 - 0",
scoreText: item.event_final_result || item.event_halftime_result || "0 - 0",
fav: false,
sportId: sportId,
isLive: true,

View File

@@ -66,7 +66,7 @@ export default function LiveScreen() {
homeTeamLogo: item.home_team_logo,
awayTeamLogo: item.away_team_logo,
meta: item.event_status,
scoreText: item.event_final_result || "0 - 0",
scoreText: item.event_final_result || item.event_halftime_result || "0 - 0",
fav: false,
leagueId: item.league_key,
sportId: state.selectedSportId ?? undefined,
@@ -157,7 +157,7 @@ export default function LiveScreen() {
contentContainerStyle={styles.listContent}
ListEmptyComponent={
<View style={styles.center}>
<ThemedText>{t("home.no_matches")}</ThemedText>
<ThemedText>{t("home.no_matches_live")}</ThemedText>
</View>
}
/>

View File

@@ -90,19 +90,23 @@ export default function LiveDetailScreen() {
eventType: "",
eventToss: "",
eventManOfMatch: "",
scores: match.scores,
stats: match.statistics,
scores: Array.isArray(match.scores) && match.scores.length > 0 && 'type' in match.scores[0]
? match.scores as { type: string; home: string; away: string; }[]
: undefined,
stats: Array.isArray(match.statistics) && match.statistics.length > 0 && 'type' in match.statistics[0]
? match.statistics as { type: string; home: string; away: string; }[]
: undefined,
players: match.player_statistics
? {
home_team: (match.player_statistics.home_team || []).map((p) => ({
...p,
player_oncourt: p.player_oncourt || undefined,
})),
away_team: (match.player_statistics.away_team || []).map((p) => ({
...p,
player_oncourt: p.player_oncourt || undefined,
})),
}
home_team: (match.player_statistics.home_team || []).map((p) => ({
...p,
player_oncourt: p.player_oncourt || undefined,
})),
away_team: (match.player_statistics.away_team || []).map((p) => ({
...p,
player_oncourt: p.player_oncourt || undefined,
})),
}
: undefined,
},
};

View File

@@ -113,8 +113,10 @@ export default function SearchScreen() {
const { t } = useTranslation();
const insets = useSafeAreaInsets();
const isDark = theme === "dark";
const textColor = isDark ? "#FFFFFF" : "#000000";
const cardBg = isDark ? "#1C1C1E" : "#FFFFFF";
const borderColor = isDark ? "#2C2C2E" : "rgba(0,0,0,0.06)";
const borderColor = isDark ? "#2C2C2E" : "rgba(0,0,0,0.1)";
const pageBg = isDark ? Colors.dark.background : "#f2f2f7";
const { state } = useAppState();
const [searchType, setSearchType] = useState<SearchType>("all");
@@ -485,7 +487,7 @@ export default function SearchScreen() {
</View>
<TouchableOpacity
style={[
styles.iconBtn,
styles.sheetBtn,
{
backgroundColor: cardBg,
borderColor: borderColor,
@@ -688,49 +690,28 @@ export default function SearchScreen() {
};
return (
<ThemedView style={styles.container}>
<ThemedView style={[styles.container, { backgroundColor: pageBg }]}>
<Stack.Screen
options={{
headerShown: false,
title: t("search.title"),
headerShown: true,
headerBackTitle: t("settings.back"),
// Ensure header matches theme to avoid white flash
headerStyle: {
backgroundColor: pageBg,
},
headerTintColor: textColor,
headerShadowVisible: false,
// Present the screen as a normal card and slide from right
presentation: "card",
animation: "slide_from_right",
// Set the scene/content background to match theme during transition
contentStyle: {
backgroundColor: pageBg,
},
}}
/>
<BlurView
intensity={80}
tint={isDark ? "dark" : "light"}
style={[
styles.nav,
{
backgroundColor: cardBg,
},
{ paddingTop: insets.top + 10 },
]}
>
<TouchableOpacity
style={[
styles.iconBtn,
{
backgroundColor: cardBg,
borderColor: borderColor,
},
]}
onPress={() => router.back()}
>
<IconSymbol
name="chevron-back"
size={20}
color={isDark ? "rgba(255,255,255,0.9)" : "rgba(0,0,0,0.9)"}
/>
</TouchableOpacity>
<View style={styles.brand}>
<ThemedText style={styles.brandTitle}>{t("search.title")}</ThemedText>
<ThemedText style={styles.brandSub}>
{t("search.subtitle")}
</ThemedText>
</View>
</BlurView>
<View style={styles.content}>
<View style={styles.contentContainer}>
{renderSearchBar()}
@@ -792,39 +773,6 @@ const styles = StyleSheet.create({
container: {
flex: 1,
},
nav: {
flexDirection: "row",
alignItems: "center",
gap: 10,
paddingHorizontal: 12,
paddingBottom: 12,
position: "sticky",
top: 0,
zIndex: 40,
},
iconBtn: {
width: 38,
height: 38,
borderRadius: 14,
alignItems: "center",
justifyContent: "center",
borderWidth: 1,
},
brand: {
flex: 1,
minWidth: 0,
gap: 2,
},
brandTitle: {
fontSize: 18,
fontWeight: "700",
letterSpacing: 0.2,
},
brandSub: {
fontSize: 12,
opacity: 0.5,
fontWeight: "600",
},
content: {
flex: 1,
},
@@ -862,7 +810,7 @@ const styles = StyleSheet.create({
},
chip: {
paddingHorizontal: 14,
paddingVertical: 8,
paddingVertical: 6,
borderRadius: 999,
borderWidth: 1,
},
@@ -920,14 +868,14 @@ const styles = StyleSheet.create({
alignItems: "center",
gap: 12,
padding: 12,
borderRadius: 18,
borderRadius: 10,
borderWidth: 1,
marginBottom: 10,
},
logoDot: {
width: 34,
height: 34,
borderRadius: 14,
borderRadius: 8,
alignItems: "center",
justifyContent: "center",
borderWidth: 1,