diff --git a/components/u/AvatarWithInfo.tsx b/components/u/AvatarWithInfo.tsx index c53ff6a1d..8a0272055 100644 --- a/components/u/AvatarWithInfo.tsx +++ b/components/u/AvatarWithInfo.tsx @@ -11,6 +11,7 @@ import { LeagueType, RankedMode } from "@prisma/client"; import ModeImage from "components/common/ModeImage"; import MyLink from "components/common/MyLink"; import SubText from "components/common/SubText"; +import TwitterAvatar from "components/common/TwitterAvatar"; import UserAvatar from "components/common/UserAvatar"; import WeaponImage from "components/common/WeaponImage"; import { countries, getEmojiFlag } from "countries-list"; @@ -83,6 +84,22 @@ const AvatarWithInfo: React.FC = ({ } )} + {user.team && ( + + {user.team.twitterName && ( + + + + )} + + {user.team.name} + + + )} {user.profile?.twitterName && ( @@ -122,7 +139,7 @@ const AvatarWithInfo: React.FC = ({ )} {user.profile?.weaponPool && user.profile?.weaponPool.length > 0 && ( = ({ alignItems="center" justifyContent="center" ml="0.7rem" - mt={1} + mt={2} color={gray} w="100%" > @@ -151,7 +168,7 @@ const AvatarWithInfo: React.FC = ({ )} {Object.keys(peakXPowers).length > 0 && ( - + {(["SZ", "TC", "RM", "CB"] as RankedMode[]) .filter((mode) => peakXPowers[mode]) .map((mode, i) => ( @@ -174,7 +191,7 @@ const AvatarWithInfo: React.FC = ({ {Object.keys(peakLeaguePowers).length > 0 && ( <> - + {(["TWIN", "QUAD"] as LeagueType[]) .filter((type) => peakLeaguePowers[type]) .map((type) => ( @@ -199,11 +216,11 @@ const AvatarWithInfo: React.FC = ({ href={`/player/${user.player?.switchAccountId}`} prefetch={true} > - )} - {true && ( + {user.salmonRunRecords.length > 0 && ( - @@ -149,6 +150,7 @@ const ProfilePage = (props: Props) => { leftIcon={} variant="outline" onClick={() => setBuildToEdit(true)} + size="sm" > Add build diff --git a/prisma/queries/getUserByIdentifier.ts b/prisma/queries/getUserByIdentifier.ts index 27df8dbeb..28936ee9a 100644 --- a/prisma/queries/getUserByIdentifier.ts +++ b/prisma/queries/getUserByIdentifier.ts @@ -51,5 +51,12 @@ export const getUserByIdentifier = (identifier: string) => freeAgentPost: { select: { id: true }, }, + team: { + select: { name: true, twitterName: true, nameForUrl: true }, + }, + salmonRunRecords: { + take: 1, + select: { id: true }, + }, }, });