diff --git a/src/components/layout/Icon/Icon.tsx b/src/components/layout/Icon/Icon.tsx index 5438e37391..5985a2ca83 100644 --- a/src/components/layout/Icon/Icon.tsx +++ b/src/components/layout/Icon/Icon.tsx @@ -31,6 +31,8 @@ import { faChevronLeft, faChevronRight, faClone, + faCheck, + faXmark, } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import classNames from 'classnames'; @@ -78,6 +80,8 @@ const SPELLBOOK_FA_ICONS = { chevronLeft: faChevronLeft, chevronRight: faChevronRight, copy: faClone, + check: faCheck, + cross: faXmark, }; export type SpellbookIcon = keyof typeof SPELLBOOK_ICONS | keyof typeof SPELLBOOK_FA_ICONS; diff --git a/src/pages/combo/[id]/combo.module.scss b/src/pages/combo/[id]/combo.module.scss index 2534731fff..29aa26bee3 100644 --- a/src/pages/combo/[id]/combo.module.scss +++ b/src/pages/combo/[id]/combo.module.scss @@ -13,3 +13,35 @@ .previewedWarning { @apply font-semibold; } + +.legalityTable { + @apply border-collapse w-full text-center mt-20 border-black ; + + th:last-child,td:last-child { + @apply text-left pl-2; + } + + thead { + @apply text-dark border-b-4; + } + + tbody { + td, th { + @apply border-2; + } + tr:first-child th { + border-top: 0; + } + tr:last-child td { + border-bottom: 0; + } + tr td:first-child, + tr th:first-child { + border-left: 0; + } + tr td:last-child, + tr th:last-child { + border-right: 0; + } + } +} diff --git a/src/pages/combo/[id]/index.tsx b/src/pages/combo/[id]/index.tsx index 8afcd1e077..32d31fca37 100644 --- a/src/pages/combo/[id]/index.tsx +++ b/src/pages/combo/[id]/index.tsx @@ -24,6 +24,7 @@ import BulkApiService from 'services/bulk-api.service'; import Loader from 'components/layout/Loader/Loader'; import ComboResults from 'components/search/ComboResults/ComboResults'; import Link from 'next/link'; +import Icon from 'components/layout/Icon/Icon'; type Props = { combo?: Variant; @@ -35,6 +36,10 @@ const NUMBERS = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', const MAX_VARIANTS_COUNT = 50; +function booleanToIcon(value: boolean) { + return value ? : ; +} + const Combo: React.FC = ({ combo, alternatives, previewImageUrl }) => { const configuration = apiConfiguration(); const variantsApi = new VariantsApi(configuration); @@ -100,6 +105,7 @@ const Combo: React.FC = ({ combo, alternatives, previewImageUrl }) => { } else if (combo.status == 'NR') { metaData.push('This combo needs to be reviewed and is only visible to editors.'); } + return ( <> = ({ combo, alternatives, previewImageUrl }) => { /> {combo.legalities && ( - - - +
FormatLegality
+ + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LegalityFormat
Commander{combo.legalities.commander ? "Legal" : "Not legal"}
Pauper Commander{combo.legalities.pauperCommanderCommander ? "Legal" : "Not legal"}
Pauper Commander (main deck){combo.legalities.pauperCommanderMain ? "Legal" : "Not legal"}
Oathbreaker{combo.legalities.oathbreaker ? "Legal" : "Not legal"}
PreDH{combo.legalities.predh ? "Legal" : "Not legal"}
Brawl{combo.legalities.brawl ? "Legal" : "Not legal"}
Vintage{combo.legalities.vintage ? "Legal" : "Not legal"}
Legacy{combo.legalities.legacy ? "Legal" : "Not legal"}
Modern{combo.legalities.modern ? "Legal" : "Not legal"}
Pioneer{combo.legalities.pioneer ? "Legal" : "Not legal"}
Standard{combo.legalities.standard ? "Legal" : "Not legal"}
Pauper{combo.legalities.pauper ? "Legal" : "Not legal"}
{booleanToIcon(combo.legalities.commander)}Commander
{booleanToIcon(combo.legalities.pauperCommander)}Pauper Commander
{booleanToIcon(combo.legalities.pauperCommanderMain)}Pauper Commander in 99
{booleanToIcon(combo.legalities.oathbreaker)}Oathbreaker
{booleanToIcon(combo.legalities.predh)}PreDH
{booleanToIcon(combo.legalities.brawl)}Brawl
{booleanToIcon(combo.legalities.standard)}Standard
{booleanToIcon(combo.legalities.pioneer)}Pioneer
{booleanToIcon(combo.legalities.modern)}Modern
{booleanToIcon(combo.legalities.pauper)}Pauper
{booleanToIcon(combo.legalities.legacy)}Legacy
{booleanToIcon(combo.legalities.vintage)}Vintage
)}