Skip to content

Commit

Permalink
Decoding effect
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomyj committed Mar 27, 2024
1 parent eb48225 commit 6b94077
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/banlist/content/CardsWithDifferentStatus.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Typography } from '@mui/material'
import { FC, useEffect, useState } from 'react'
import { decodeHTML } from 'entities'
import { YGOCardWithPreviousBanStatus } from 'skc-rcl'

type CardsWithDifferentStatusProps = {
Expand All @@ -15,6 +16,7 @@ const CardsWithDifferentStatus: FC<CardsWithDifferentStatusProps> = ({ newStatus
setCardsWithNewStatus(
cards.map((newStatus: SKCCardsPreviousBanListStatus) => {
const card: SKCCard = newStatus.card
card.cardEffect = decodeHTML(card.cardEffect)

return <YGOCardWithPreviousBanStatus key={`${newStatusName}-${card.cardID}`} card={card} previousBanStatus={newStatus.previousBanStatus} />
})
Expand Down
3 changes: 3 additions & 0 deletions src/components/card/suggestion/CardSuggestions.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '../../../css/card/ygo-card-suggestion.css'
import { FC, Fragment, lazy, Suspense, useEffect, useState, useCallback } from 'react'
import { decodeHTML } from 'entities'
import { Skeleton } from '@mui/material'

import FetchHandler from '../../../helper/FetchHandler'
Expand Down Expand Up @@ -59,6 +60,7 @@ const CardSuggestions: FC<_CardSuggestion> = ({ cardID, cardColor, cardName }) =

return references !== null
? references.map((reference: CardReference) => {
reference.card.cardEffect = decodeHTML(reference.card.cardEffect)
return (
<a key={reference.card.cardID} href={`/card/${reference.card.cardID}`} className='suggested-ygo-card-wrapper aggregate-anchor'>
<YGOCardWithQuantity card={reference.card} occurrences={reference.occurrences} />
Expand All @@ -77,6 +79,7 @@ const CardSuggestions: FC<_CardSuggestion> = ({ cardID, cardColor, cardName }) =

return support !== null
? support.map((reference: SKCCard) => {
reference.cardEffect = decodeHTML(reference.cardEffect)
return (
<a key={reference.cardID} href={`/card/${reference.cardID}`} className='suggested-ygo-card-wrapper aggregate-anchor'>
<YGOCardWithImage key={reference.cardID} card={reference} imgLoadingType='lazy' />
Expand Down
3 changes: 3 additions & 0 deletions src/components/util/grid/CardGridItems.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Grid2 from '@mui/material/Unstable_Grid2'
import { FC, Fragment, useEffect, useState } from 'react'
import { decodeHTML } from 'entities'
import { YGOCardWithImage } from 'skc-rcl'

const CardGridItems: FC<{ cards: SKCCard[] }> = ({ cards }) => {
Expand All @@ -14,6 +15,8 @@ const CardGridItems: FC<{ cards: SKCCard[] }> = ({ cards }) => {
}

const CardGridItem: FC<{ card: SKCCard }> = ({ card }) => {
card.cardEffect = decodeHTML(card.cardEffect)

return (
<Grid2 className='ygo-card-grid-item' id={card.cardID} key={card.cardID} xs={6} sm={4} md={4} lg={3} xl={2}>
<a href={`/card/${card.cardID}`} className='aggregate-anchor'>
Expand Down

0 comments on commit 6b94077

Please sign in to comment.