Commit aacf8ace authored by Chunchi Che's avatar Chunchi Che

optimize SelectCardsModal

parent 6482b896
Pipeline #23381 passed with stages
in 12 minutes and 42 seconds
...@@ -45,6 +45,13 @@ ...@@ -45,6 +45,13 @@
margin-inline-end: 0; margin-inline-end: 0;
margin-block-end: 0; margin-block-end: 0;
flex-shrink: 0; flex-shrink: 0;
&.opponent {
&::before {
background-color: #dc003433;
box-shadow: 0 0 0 2px #d22d2d inset;
}
}
} }
.card { .card {
......
import { CheckCard } from "@ant-design/pro-components"; import { CheckCard } from "@ant-design/pro-components";
import { Button, Card, Segmented, Space, Tooltip } from "antd"; import { Button, Card, Segmented, Space, Tooltip } from "antd";
import classnames from "classnames";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { INTERNAL_Snapshot as Snapshot, useSnapshot } from "valtio"; import { INTERNAL_Snapshot as Snapshot, useSnapshot } from "valtio";
import { type CardMeta, Region, type ygopro } from "@/api"; import { type CardMeta, Region, type ygopro } from "@/api";
import { fetchStrings } from "@/api"; import { fetchStrings } from "@/api";
import { CardType, matStore } from "@/stores"; import { CardType, isMe, matStore } from "@/stores";
import { YgoCard } from "@/ui/Shared"; import { YgoCard } from "@/ui/Shared";
import { groupBy } from "../../utils"; import { groupBy } from "../../utils";
...@@ -176,7 +177,11 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({ ...@@ -176,7 +177,11 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({
className={styles.card} className={styles.card}
/> />
} }
className={styles["check-card"]} className={classnames(styles["check-card"], {
[styles.opponent]:
card.location?.controller !== undefined &&
!isMe(card.location.controller),
})}
value={card} value={card}
onClick={() => { onClick={() => {
showCardModal(card); showCardModal(card);
......
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