Skip to content

Commit

Permalink
fix: check if gacha actually has pickups
Browse files Browse the repository at this point in the history
  • Loading branch information
candela97 committed Nov 5, 2023
1 parent 38e4d64 commit d63c56b
Showing 1 changed file with 32 additions and 28 deletions.
60 changes: 32 additions & 28 deletions src/pages/gacha/GachaDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -859,34 +859,38 @@ const GachaDetailPage: React.FC<{}> = observer(() => {
<TypographyHeader>{t("gacha:gacha_cards")}</TypographyHeader>
<ContainerContent maxWidth="md">
<Grid container direction="row">
<Grid item xs={12}>
<Grid
container
wrap="nowrap"
justifyContent="space-between"
alignItems="center"
>
<Typography variant="subtitle1" style={{ fontWeight: 600 }}>
{t("gacha:pickupMember", {
count: gacha.gachaPickups.length,
})}
</Typography>
<Button
onClick={() => {
setGachaCards(
gacha.gachaPickups.map((pickup) => pickup.cardId)
);
setIsCardsDialog(true);
}}
variant="contained"
>
{t("common:show")}
</Button>
</Grid>
</Grid>
<Grid item xs={12}>
<Divider style={{ margin: "1% 0" }} />
</Grid>
{gacha.gachaDetails.some((detail) => detail.weight > 1) && (
<Fragment>
<Grid item xs={12}>
<Grid
container
wrap="nowrap"
justifyContent="space-between"
alignItems="center"
>
<Typography variant="subtitle1" style={{ fontWeight: 600 }}>
{t("gacha:pickupMember", {
count: gacha.gachaPickups.length,
})}
</Typography>
<Button
onClick={() => {
setGachaCards(
gacha.gachaPickups.map((pickup) => pickup.cardId)
);
setIsCardsDialog(true);
}}
variant="contained"
>
{t("common:show")}
</Button>
</Grid>
</Grid>
<Grid item xs={12}>
<Divider style={{ margin: "1% 0" }} />
</Grid>
</Fragment>
)}
{gachaRarityRates.map((rate, idx) => (
<Fragment key={idx}>
<Grid item xs={12}>
Expand Down

0 comments on commit d63c56b

Please sign in to comment.