|
@@ -10,10 +10,9 @@ import zhCN from "date-fns/locale/zh-CN"; // 中文本地化
|
|
|
import Image from "next/image";
|
|
|
import { Minus, Plus, Play, X, Check, Clock } from "lucide-react";
|
|
|
|
|
|
-const defaultLogo = "https://via.placeholder.com/30x20";
|
|
|
+const defaultLogo = "/images/default_logo.png";
|
|
|
|
|
|
-const no_goal_logo =
|
|
|
- "https://games.the-afc.com/predictor/static-assets/build/images/Default_flag.svg?v=2.4";
|
|
|
+const no_goal_logo = "/images/no_goal_logo.png";
|
|
|
|
|
|
const isValidUrl = (url) => {
|
|
|
try {
|
|
@@ -343,7 +342,7 @@ const MatchPrediction = ({ selectedDayMatches }) => {
|
|
|
onClick={() => handleWinTeamSelect(match._id, "draw")}
|
|
|
>
|
|
|
<Image
|
|
|
- src="https://games.the-afc.com/predictor/static-assets/build/images/clubs/Draw_flag.png?v=2.4"
|
|
|
+ src="/images/draw_flag.png"
|
|
|
width={40}
|
|
|
height={40}
|
|
|
alt="Handshake"
|
|
@@ -394,7 +393,7 @@ const MatchPrediction = ({ selectedDayMatches }) => {
|
|
|
<span className="text-sm">First team to score</span>
|
|
|
{selectedFirstTeamToScoreOfMatch[match._id] ||
|
|
|
firstTeamToScore ? (
|
|
|
- <FlagImage
|
|
|
+ <Image
|
|
|
src={getValidImageUrl(
|
|
|
selectedFirstTeamToScoreOfMatch[match._id]?.logo ||
|
|
|
firstTeamToScoreLogo
|
|
@@ -575,13 +574,15 @@ const TeamCard = ({ flag, name, lastMatches, pickedBy, selected, onClick }) => {
|
|
|
className="flex flex-col items-center bg-white text-black text-sm rounded-md px-2 py-2 relative"
|
|
|
onClick={onClick}
|
|
|
>
|
|
|
- <Image
|
|
|
- src={getValidImageUrl(flag)}
|
|
|
- width={30}
|
|
|
- height={20}
|
|
|
- alt={`${name} flag`}
|
|
|
- className="mb-2"
|
|
|
- />
|
|
|
+ <div className="w-10 h-10">
|
|
|
+ <Image
|
|
|
+ src={getValidImageUrl(flag)}
|
|
|
+ width={40}
|
|
|
+ height={40}
|
|
|
+ alt={`${name} flag`}
|
|
|
+ className="mb-2"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<span className="font-bold mb-1 pt-4 pb-6">{name}</span>
|
|
|
{/* <span className="text-xs mb-1">Last 5 matches</span>
|
|
|
<span className="text-sm mb-1">{lastMatches}</span>
|
|
@@ -607,52 +608,45 @@ const TeamOption = ({ flag, name, isSelected, onSelect }) => (
|
|
|
onClick={onSelect}
|
|
|
>
|
|
|
<div className="flex items-center">
|
|
|
- {/* <Image
|
|
|
+ <Image
|
|
|
src={flag}
|
|
|
width={30}
|
|
|
- height={20}
|
|
|
- alt={`${name} flag`}
|
|
|
+ height={30}
|
|
|
className="mr-3"
|
|
|
- /> */}
|
|
|
- <FlagImage
|
|
|
- src={flag}
|
|
|
- width={30}
|
|
|
- height={20}
|
|
|
alt={`${name} flag`}
|
|
|
- className="mr-3"
|
|
|
+ onClick={onSelect}
|
|
|
/>
|
|
|
-
|
|
|
<span>{name}</span>
|
|
|
</div>
|
|
|
{isSelected && <Check size={24} />}
|
|
|
</div>
|
|
|
);
|
|
|
|
|
|
-const FlagImage = ({ src, alt, width, height, className, onClick }) => {
|
|
|
- const isSvg = src.split("?")[0].endsWith(".svg");
|
|
|
- if (isSvg) {
|
|
|
- return (
|
|
|
- <img
|
|
|
- src={src}
|
|
|
- alt={alt}
|
|
|
- width={width}
|
|
|
- height={height}
|
|
|
- className={className}
|
|
|
- onClick={onClick}
|
|
|
- />
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- return (
|
|
|
- <Image
|
|
|
- src={src}
|
|
|
- width={width}
|
|
|
- height={height}
|
|
|
- alt={alt}
|
|
|
- className={className}
|
|
|
- onClick={onClick}
|
|
|
- />
|
|
|
- );
|
|
|
-};
|
|
|
+// const FlagImage = ({ src, alt, width, height, className, onClick }) => {
|
|
|
+// const isSvg = src.split("?")[0].endsWith(".svg");
|
|
|
+// if (isSvg) {
|
|
|
+// return (
|
|
|
+// <img
|
|
|
+// src={src}
|
|
|
+// alt={alt}
|
|
|
+// width={width}
|
|
|
+// height={height}
|
|
|
+// className={className}
|
|
|
+// onClick={onClick}
|
|
|
+// />
|
|
|
+// );
|
|
|
+// }
|
|
|
+
|
|
|
+// return (
|
|
|
+// <Image
|
|
|
+// src={src}
|
|
|
+// width={width}
|
|
|
+// height={height}
|
|
|
+// alt={alt}
|
|
|
+// className={className}
|
|
|
+// onClick={onClick}
|
|
|
+// />
|
|
|
+// );
|
|
|
+// };
|
|
|
|
|
|
export default MatchPrediction;
|