瀏覽代碼

feat: 修改

year 2 天之前
父節點
當前提交
f738e3cd31
共有 3 個文件被更改,包括 16 次插入4 次删除
  1. 二進制
      public/img/game_placeholder.webp
  2. 二進制
      public_original/img/game_placeholder.png
  3. 16 4
      src/components/Image/index.tsx

二進制
public/img/game_placeholder.webp


二進制
public_original/img/game_placeholder.png


+ 16 - 4
src/components/Image/index.tsx

@@ -11,15 +11,27 @@ const CustomImage = ({ onError, src, ...props }: ImageProps) => {
     if (isError) {
         return (
             <div className="flex h-[100%] flex-col items-center justify-center text-center">
-                <i className="iconfont icon-jinbi text-[.3rem] text-[var(--textColor1)]"></i>
-                <span className="text-[11px] leading-[1] text-[var(--textColor1)]">
+                <img src="/img/game_placeholder.webp" className="w-[.5rem]" alt="" />
+                {/* <span className="text-[11px] leading-[1] text-[var(--textColor1)]">
                     Falha no carregamento
-                </span>
+                </span> */}
             </div>
         );
     }
     // eslint-disable-next-line jsx-a11y/alt-text
-    return <Image {...props} src={src} onError={onErrorHandler}></Image>;
+    return (
+        <Image
+            {...props}
+            src={src}
+            onError={onErrorHandler}
+            placeholder={
+                <div className="flex h-full items-center justify-center">
+                    <img src="/img/game_placeholder.webp" className="w-[.5rem]" alt="" />
+                </div>
+            }
+            alt={props.alt || ""}
+        ></Image>
+    );
 };
 
 export default CustomImage;