From da3e0c02494287bb8c69c6fb25e0245c1b857754 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 9 Nov 2021 18:00:46 -0500 Subject: [PATCH] add remaining fields --- src/components/_mobile/collection/Attack.tsx | 73 +++++++++++++------ .../_mobile/collection/ChaoticCard.ts | 14 ++++ 2 files changed, 64 insertions(+), 23 deletions(-) create mode 100644 src/components/_mobile/collection/ChaoticCard.ts diff --git a/src/components/_mobile/collection/Attack.tsx b/src/components/_mobile/collection/Attack.tsx index 4199154..76d0d89 100644 --- a/src/components/_mobile/collection/Attack.tsx +++ b/src/components/_mobile/collection/Attack.tsx @@ -1,41 +1,68 @@ import { Card, CardContent, CardHeader, CardMedia, Typography, Box } from '@mui/material'; import React from 'react'; import { Attack } from "../../common/definitions"; -import { Ability, Name } from '../../Snippets'; +import { AttackIcon, ElementIcon, Name, RarityIcon } from '../../Snippets'; import { abilityText } from '../../Snippets/abilityText'; import { uniqueText } from '../../Snippets/uniqueText'; import API from '../../SpreadsheetData'; +import { ChaoticCard } from './ChaoticCard'; -interface props { - card: Attack - ext: boolean -} - -export default function AttackCard ({ card, ext }: props) { +const AttackCard: ChaoticCard = ({ card, ext }) => { const ability = abilityText({ ability: card.gsx$ability }); const unique = uniqueText({ data: { unique: card.gsx$unique, loyal: card.gsx$loyal, legendary: card.gsx$legendary }}); const flavor = card.gsx$flavortext; - return ( - - } - /> - + return (ext === false) + ? ( + - + + + + Attack - {card.gsx$bp} + + {`${card.gsx$base} | `} + {`${card.gsx$fire} `} + {`${card.gsx$air} `} + {`${card.gsx$earth} `} + {`${card.gsx$water}`} + + + {ability} {unique && {unique}} {flavor && {flavor}} - Art By: {card.gsx$artist} - - - - ); -} + + + ) + : ( + + } + /> + + + + {ability} + {unique && {unique}} + {flavor && {flavor}} + Art By: {card.gsx$artist} + + + + ); +}; + +export default AttackCard; diff --git a/src/components/_mobile/collection/ChaoticCard.ts b/src/components/_mobile/collection/ChaoticCard.ts new file mode 100644 index 0000000..dc39bfa --- /dev/null +++ b/src/components/_mobile/collection/ChaoticCard.ts @@ -0,0 +1,14 @@ +import { Card } from "../../common/definitions"; + +export type statsType = "avg" | "min" | "max"; + +export interface chaoticCardProps { + card: T + ext: boolean + stats: statsType + hideStats: boolean + } + +export interface ChaoticCard { + (props: chaoticCardProps): JSX.Element +}