实现直播详情页
This commit is contained in:
@@ -9,9 +9,10 @@ import { Pressable, StyleSheet, View } from "react-native";
|
||||
|
||||
interface MatchCardProps {
|
||||
match: Match;
|
||||
onPress?: (match: Match) => void;
|
||||
}
|
||||
|
||||
export function MatchCard({ match }: MatchCardProps) {
|
||||
export function MatchCard({ match, onPress }: MatchCardProps) {
|
||||
const router = useRouter();
|
||||
const { theme } = useTheme();
|
||||
const isDark = theme === "dark";
|
||||
@@ -20,7 +21,11 @@ export function MatchCard({ match }: MatchCardProps) {
|
||||
const borderColor = isDark ? "#38383A" : "#E5E5EA";
|
||||
|
||||
const handlePress = () => {
|
||||
router.push(`/match-detail/${match.id}`);
|
||||
if (onPress) {
|
||||
onPress(match);
|
||||
} else {
|
||||
router.push(`/match-detail/${match.id}`);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user