Commit 3c10708d authored by Chunchi Che's avatar Chunchi Che

update cardListModal slice

parent 220041bd
Pipeline #20606 passed with stages
in 5 minutes and 50 seconds
import { PayloadAction, CaseReducer } from "@reduxjs/toolkit";
import { DuelState } from "../mod";
import { RootState } from "../../../store";
import { CardMeta } from "../../../api/cards";
// 更新卡牌列表弹窗打开状态
export const setCardListModalIsOpenImpl: CaseReducer<
......@@ -15,9 +16,7 @@ export const setCardListModalInfoImpl: CaseReducer<
DuelState,
PayloadAction<
{
name?: string;
desc?: string;
imgUrl?: string;
meta?: CardMeta;
interactivies: { desc: string; response: number }[];
}[]
>
......
......@@ -12,9 +12,7 @@ export interface ModalState {
cardListModal: {
isOpen: boolean;
list: {
name?: string;
desc?: string;
imgUrl?: string;
meta?: CardMeta;
interactivies: { desc: string; response: number }[];
}[];
};
......
......@@ -11,6 +11,7 @@ import {
} from "../../reducers/duel/mod";
import { Drawer, List, Button } from "antd";
import { sendSelectIdleCmdResponse } from "../../api/ocgcore/ocgHelper";
import NeosConfig from "../../../neos.config.json";
const CARD_WIDTH = 100;
......@@ -45,13 +46,16 @@ const CardListModal = () => {
))}
extra={
<img
alt={item.name}
src={item.imgUrl}
alt={item.meta?.text.name}
src={`${NeosConfig.cardImgUrl}/${item.meta?.id}.jpg`}
style={{ width: CARD_WIDTH }}
/>
}
>
<List.Item.Meta title={item.name} description={item.desc} />
<List.Item.Meta
title={item.meta?.text.name}
description={item.meta?.text.desc}
/>
</List.Item>
)}
></List>
......
......@@ -38,9 +38,7 @@ const SingleSlot = (props: {
)
.map((item) => {
return {
name: item.occupant?.text.name,
desc: item.occupant?.text.desc,
imgUrl: `${NeosConfig.cardImgUrl}/${item.occupant?.id}.jpg`,
meta: item.occupant,
interactivies: item.idleInteractivities.map((interactivy) => {
return {
desc: interactTypeToString(interactivy.interactType),
......
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