diff --git a/app/components/Avatar.module.css b/app/components/Avatar.module.css index 9f13fa552..3c3d66b2b 100644 --- a/app/components/Avatar.module.css +++ b/app/components/Avatar.module.css @@ -8,10 +8,17 @@ } .avatarWrapper { + display: inline-flex; flex-shrink: 0; width: fit-content; height: fit-content; background-color: var(--color-bg-higher); + border-radius: 50%; overflow: hidden; + line-height: 0; +} + +.avatarWrapper img { + display: block; border-radius: 50%; } diff --git a/app/components/Avatar.tsx b/app/components/Avatar.tsx index f93f53039..3d015e0c3 100644 --- a/app/components/Avatar.tsx +++ b/app/components/Avatar.tsx @@ -18,13 +18,15 @@ const dimensions = { export function Avatar({ user, url, + identiconInput, size = "sm", className, alt = "", ...rest }: { user?: Pick; - url?: string; + url?: string | null; + identiconInput?: string; className?: string; alt?: string; size: keyof typeof dimensions; @@ -111,7 +113,14 @@ export function Avatar({ return canvas.toDataURL(); } - const isIdenticon = !url && (!user?.discordAvatar || isErrored); + const isIdenticon = + !url && (!user?.discordAvatar || isErrored || identiconInput); + + const identiconSource = () => { + if (identiconInput) return identiconInput; + if (user) return user.discordId; + return "unknown"; + }; const src = url ? url @@ -122,17 +131,13 @@ export function Avatar({ size: size === "lg" ? "lg" : "sm", }) : isClient - ? generateIdenticon( - user ? user.discordId : "unknown", - dimensions[size], - 7, - ) + ? generateIdenticon(identiconSource(), dimensions[size], 7) : BLANK_IMAGE_URL; return ( -
+
99; @@ -248,7 +248,14 @@ function MatchRow({ > {team?.seed}
- {logoSrc ? : null} + {showAvatar ? ( + + ) : null}
diff --git a/app/features/tournament-bracket/components/MatchRosters.tsx b/app/features/tournament-bracket/components/MatchRosters.tsx index 50a732d83..ca3c887a8 100644 --- a/app/features/tournament-bracket/components/MatchRosters.tsx +++ b/app/features/tournament-bracket/components/MatchRosters.tsx @@ -47,7 +47,7 @@ export function MatchRosters({

{teamOne ? ( @@ -58,9 +58,11 @@ export function MatchRosters({ })} className="text-main-forced font-bold stack horizontal xs items-center" > - {teamOneLogoSrc ? ( - - ) : null} + {teamOne.name} ) : ( @@ -105,7 +107,7 @@ export function MatchRosters({

{teamTwo ? ( @@ -116,9 +118,11 @@ export function MatchRosters({ })} className="text-main-forced font-bold stack horizontal xs items-center" > - {teamTwoLogoSrc ? ( - - ) : null} + {teamTwo.name} ) : ( diff --git a/app/features/tournament/components/TeamWithRoster.tsx b/app/features/tournament/components/TeamWithRoster.tsx index 760905c51..f94712ea5 100644 --- a/app/features/tournament/components/TeamWithRoster.tsx +++ b/app/features/tournament/components/TeamWithRoster.tsx @@ -35,7 +35,7 @@ export function TeamWithRoster({
- {teamLogoSrc ? : null} + {seed ? (
#{seed}
) : null} diff --git a/app/features/tournament/routes/to.$id.results.tsx b/app/features/tournament/routes/to.$id.results.tsx index bb56ce235..9386aafe3 100644 --- a/app/features/tournament/routes/to.$id.results.tsx +++ b/app/features/tournament/routes/to.$id.results.tsx @@ -139,7 +139,11 @@ function ResultsTable({ standings }: { standings: Standing[] }) { className={styles.standingsTeamName} data-testid="result-team-name" > - {teamLogoSrc ? : null}{" "} + {" "} {standing.team.name} diff --git a/app/features/tournament/routes/to.$id.seeds.tsx b/app/features/tournament/routes/to.$id.seeds.tsx index 5e89059aa..e2cc105ee 100644 --- a/app/features/tournament/routes/to.$id.seeds.tsx +++ b/app/features/tournament/routes/to.$id.seeds.tsx @@ -381,7 +381,9 @@ function RowContents({ return ( <>
{seed}
-
{logoUrl ? : null}
+
+ +
{team.checkIns.length > 0 ? "✅ " : "❌ "} {team.name}