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