Commit 080e6534 authored by chechunchi's avatar chechunchi

fix YgoCard

parent 2747fa3e
Pipeline #22475 passed with stages
in 13 minutes and 31 seconds
.skeleton-cover {
background-color: gray;
}
.ygo-card {
aspect-ratio: var(--card-ratio);
}
......@@ -25,22 +25,12 @@ export const YgoCard: React.FC<Props> = (props) => {
} = props;
return useMemo(
() => (
<>
{code === 0 && !isBack ? (
<div
className={classNames("ygo-card", "skeleton-cover", className)}
style={{ width, ...style }}
onClick={onClick}
/>
) : (
<img
className={classNames("ygo-card", className)}
src={getCardImgUrl(code, isBack)}
style={{ width, ...style }}
onClick={onClick}
/>
)}
</>
<img
className={classNames("ygo-card", className)}
src={getCardImgUrl(code, isBack)}
style={{ width, ...style }}
onClick={onClick}
/>
),
[code]
);
......@@ -53,7 +43,7 @@ function getCardImgUrl(code: number, back = false) {
import.meta.env.BASE_URL === "/"
? NeosConfig.assetsPath
: `${import.meta.env.BASE_URL}${NeosConfig.assetsPath}`;
if (back) {
if (back || code === 0) {
return `${ASSETS_BASE}/card_back.jpg`;
}
return `${NeosConfig.cardImgUrl}/${code}.jpg`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment