From 11f2ef1a2c54344abb31c4fc3064744993425534 Mon Sep 17 00:00:00 2001 From: "Kalle (Sendou)" <38327916+Sendouc@users.noreply.github.com> Date: Fri, 14 Jan 2022 09:40:17 +0200 Subject: [PATCH] Match link styles --- .stylelintrc.json | 3 +- .../tournament/EliminationBracketMatch.tsx | 110 +++++++++++------- app/styles/tournament-bracket.css | 12 +- 3 files changed, 79 insertions(+), 46 deletions(-) diff --git a/.stylelintrc.json b/.stylelintrc.json index 1d4b251d9..8f6775560 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -12,6 +12,7 @@ "ignorePseudoClasses": ["global"] } ], - "selector-class-pattern": ["[a-z-_]+"] + "selector-class-pattern": ["[a-z-_]+"], + "custom-property-pattern": "(?<=_?)" } } diff --git a/app/components/tournament/EliminationBracketMatch.tsx b/app/components/tournament/EliminationBracketMatch.tsx index 54a22a755..10928a85f 100644 --- a/app/components/tournament/EliminationBracketMatch.tsx +++ b/app/components/tournament/EliminationBracketMatch.tsx @@ -1,4 +1,6 @@ import clsx from "clsx"; +import * as React from "react"; +import { Link } from "remix"; import type { BracketModified } from "~/services/bracket"; import { Unpacked } from "~/utils"; @@ -25,53 +27,73 @@ export function EliminationBracketMatch({ return null; }; + const Container = ({ children }: { children: React.ReactNode }) => { + const hasBothParticipants = + (match.participants?.filter(Boolean).length ?? 0) > 1; + + if (hasBothParticipants) + return ( + + {children} + + ); + + return <>{children}; + }; + return ( -