Skip to content

Commit

Permalink
fix: #489
Browse files Browse the repository at this point in the history
  • Loading branch information
ldeluigi committed May 29, 2024
1 parent 22bef8f commit 85f0ed3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/combo/CardGroup/CardGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const CardGroup = ({ cards, templates }: Props) => {
onMouseLeave={() => setHoveredOverCardIndex(-1)}
>
{'template' in card ?
<TemplateCard template={card}/>
<TemplateCard className={styles.cardImg} template={card}/>
:
<CardLink className="relative" name={card.name}>
<CardImage
Expand Down
10 changes: 6 additions & 4 deletions src/components/combo/TemplateCard/TemplateCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import ScryfallResultsWheel from "components/combo/TemplateCard/ScryfallResultsW

type Props = {
template: Template
className?: string
imgClassName?: string
}

const TemplateCard = ({template}: Props) => {
const TemplateCard = ({template, className, imgClassName}: Props) => {

const [resultCount, setResultCount] = useState(0);
const [results, setResults] = useState<ScryfallCard.Any[]>([]);
Expand All @@ -28,8 +30,8 @@ const TemplateCard = ({template}: Props) => {
}, []);

return (
<div>
<div className="rounded-xl relative" style={{backgroundColor: '#404040'}}>
<div className="relative">
<div className={`rounded-xl ${className ?? ''}`} style={{backgroundColor: '#404040'}}>
<div className="absolute -top-5 text-center w-full text-white font-bold text-[16px] p-7"><TextWithMagicSymbol text={template.template.name}/></div>
<div className="absolute top-[60px] flex flex-col justify-center w-full items-center z-10">
{loading ? <Loader/> : <ScryfallResultsWheel cards={results}/>}
Expand All @@ -38,7 +40,7 @@ const TemplateCard = ({template}: Props) => {
{/*<div className="text-center w-full font-bold italic text-gray-400">{loading ? <Loader/> : `${resultCount} legal cards`}</div>*/}
<ScryfallResultsModal count={resultCount} scryfallApiUrl={template.template.scryfallApi} title={template.template.name}/>
</div>
<img className="opacity-10" src={cardBack.src} alt="MTG Card Back"/>
<img className={`opacity-10 ${imgClassName ?? ''}`} src={cardBack.src} alt="MTG Card Back"/>
</div>
</div>
)
Expand Down

0 comments on commit 85f0ed3

Please sign in to comment.