mirror of https://github.com/msgbyte/tailchat
feat: 原神抽卡模拟增加抽卡结果
parent
e70cc588d3
commit
f6d5f29cb5
@ -0,0 +1,25 @@
|
|||||||
|
import { AppWishResult } from 'genshin-gacha-kit';
|
||||||
|
import React from 'react';
|
||||||
|
import { WishResultText } from './WishResultText';
|
||||||
|
|
||||||
|
interface GachaResultProps {
|
||||||
|
gachaResult: AppWishResult;
|
||||||
|
}
|
||||||
|
export const GachaResult: React.FC<GachaResultProps> = React.memo((props) => {
|
||||||
|
const { gachaResult } = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<WishResultText label="5星" items={gachaResult.ssr} />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<WishResultText label="4星" items={gachaResult.sr} />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<WishResultText label="3星" items={gachaResult.r} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
GachaResult.displayName = 'GachaResult';
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
import { ModalWrapper } from '@capital/common';
|
||||||
|
import { AppGachaItem } from 'genshin-gacha-kit';
|
||||||
|
import React from 'react';
|
||||||
|
import { GachaResult } from './GachaResult';
|
||||||
|
|
||||||
|
export const WishResultModal: React.FC<{ items: AppGachaItem[] }> = React.memo(
|
||||||
|
({ items }) => {
|
||||||
|
return (
|
||||||
|
<ModalWrapper title="抽卡结果">
|
||||||
|
<GachaResult
|
||||||
|
gachaResult={{
|
||||||
|
ssr: items.filter((i) => i.rarity === 5),
|
||||||
|
sr: items.filter((i) => i.rarity === 4),
|
||||||
|
r: items.filter((i) => i.rarity === 3),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</ModalWrapper>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
WishResultModal.displayName = 'WishResultModal';
|
||||||
Loading…
Reference in New Issue