From e3926dce7350c7570a4364d630db22faf132087f Mon Sep 17 00:00:00 2001 From: Sendou <38327916+Sendouc@users.noreply.github.com> Date: Wed, 6 May 2020 02:29:49 +0300 Subject: [PATCH] use discord avatars --- .../components/calendar/TournamentInfo.tsx | 4 ++-- .../src/components/common/UserAvatar.tsx | 13 +++------- .../components/freeagents/FreeAgentCard.tsx | 2 +- .../src/components/freeagents/Matches.tsx | 9 +++---- .../src/components/plus/PersonForVoting.tsx | 4 ++-- .../src/components/plus/Suggestions.tsx | 24 ++++++++----------- .../src/components/plus/Summaries.tsx | 4 ++-- .../src/components/plus/VotingHistoryPage.tsx | 10 ++++---- .../plusdraftcup/DraftLeaderboard.tsx | 8 +++---- .../src/components/root/SideNavContent.tsx | 5 +--- .../src/components/team/LogoHeader.tsx | 2 +- .../src/components/team/MemberCard.tsx | 2 +- .../src/components/user/AvatarWithInfo.tsx | 8 ++----- .../components/usersearch/UserSearchPage.tsx | 5 +--- .../components/xsearch/Top500BrowserPage.tsx | 7 ------ .../src/graphql/queries/freeAgentMatches.ts | 3 ++- .../src/graphql/queries/freeAgentPosts.ts | 1 + .../src/graphql/queries/searchForUser.ts | 1 + .../src/graphql/queries/upcomingEvents.ts | 2 ++ frontend-react/src/graphql/queries/user.ts | 1 + frontend-react/src/graphql/queries/users.ts | 2 ++ .../src/graphql/queries/usersForVoting.ts | 8 +++---- frontend-react/src/types.ts | 3 +++ graphql-schemas/user.js | 5 ++++ 24 files changed, 59 insertions(+), 74 deletions(-) diff --git a/frontend-react/src/components/calendar/TournamentInfo.tsx b/frontend-react/src/components/calendar/TournamentInfo.tsx index c7bf59710..c5135564c 100644 --- a/frontend-react/src/components/calendar/TournamentInfo.tsx +++ b/frontend-react/src/components/calendar/TournamentInfo.tsx @@ -47,11 +47,11 @@ const TournamentInfo: React.FC = ({ - {poster.twitter_name && ( + {poster.avatar && ( diff --git a/frontend-react/src/components/common/UserAvatar.tsx b/frontend-react/src/components/common/UserAvatar.tsx index 8672a2e49..9629fd71a 100644 --- a/frontend-react/src/components/common/UserAvatar.tsx +++ b/frontend-react/src/components/common/UserAvatar.tsx @@ -3,24 +3,17 @@ import { Avatar, BoxProps } from "@chakra-ui/core" interface UserAvatarProps { name: string - twitterName?: string + src?: string size?: undefined | "2xl" | "lg" | "xs" | "sm" } const UserAvatar: React.FC = ({ name, - twitterName, + src, size, ...props }) => { - return ( - - ) + return } export default UserAvatar diff --git a/frontend-react/src/components/freeagents/FreeAgentCard.tsx b/frontend-react/src/components/freeagents/FreeAgentCard.tsx index 9e8cd498d..9cf6d5137 100644 --- a/frontend-react/src/components/freeagents/FreeAgentCard.tsx +++ b/frontend-react/src/components/freeagents/FreeAgentCard.tsx @@ -94,10 +94,10 @@ const FreeAgentCard: React.FC = ({ = ({ matches, likesReceived }) => { {matches.length > 0 ? ( <> - {matches.map(match => ( + {matches.map((match) => ( - + diff --git a/frontend-react/src/components/plus/PersonForVoting.tsx b/frontend-react/src/components/plus/PersonForVoting.tsx index 931d0fcb5..4fdb3e1f3 100644 --- a/frontend-react/src/components/plus/PersonForVoting.tsx +++ b/frontend-react/src/components/plus/PersonForVoting.tsx @@ -57,7 +57,7 @@ interface PersonForVotingProps { user: { username: string discriminator: string - twitter_name?: string | undefined + avatar?: string discord_id: string } suggester?: { @@ -98,7 +98,7 @@ const PersonForVoting: React.FC = ({ alignItems="center" flexDirection="column" > - + = ({ user }) => { if (!data.suggestions || !user.plus) return null const ownSuggestion = data.suggestions.find( - suggestion => + (suggestion) => suggestion.suggester_discord_user.discord_id === user.discord_id ) @@ -113,28 +113,24 @@ const Suggestions: React.FC = ({ user }) => { } const plusOneVouches = vouchesData.vouches.filter( - vouch => vouch.plus.vouch_status === "ONE" + (vouch) => vouch.plus.vouch_status === "ONE" ) const plusTwoVouches = vouchesData.vouches.filter( - vouch => vouch.plus.vouch_status === "TWO" + (vouch) => vouch.plus.vouch_status === "TWO" ) const plusOneSuggested = data.suggestions.filter( - suggestion => suggestion.plus_server === "ONE" + (suggestion) => suggestion.plus_server === "ONE" ) const plusTwoSuggested = data.suggestions.filter( - suggestion => suggestion.plus_server === "TWO" + (suggestion) => suggestion.plus_server === "TWO" ) const vouchMap = (vouch: VouchUser) => { return ( - + @@ -158,7 +154,7 @@ const Suggestions: React.FC = ({ user }) => { @@ -221,7 +217,7 @@ const Suggestions: React.FC = ({ user }) => { {!isSmall ? ( setTabIndex(chosenIndex)} + onChange={(chosenIndex) => setTabIndex(chosenIndex)} isFitted variant="line" mt="2em" diff --git a/frontend-react/src/components/plus/Summaries.tsx b/frontend-react/src/components/plus/Summaries.tsx index 23fbf0d6c..a1f9eea1a 100644 --- a/frontend-react/src/components/plus/Summaries.tsx +++ b/frontend-react/src/components/plus/Summaries.tsx @@ -68,7 +68,7 @@ const Summaries: React.FC = ({ summaries }) => { const members: Summary[] = [] const suggested: Summary[] = [] - summaries.forEach(summary => { + summaries.forEach((summary) => { if (summary.suggested) suggested.push(summary) else members.push(summary) }) @@ -79,7 +79,7 @@ const Summaries: React.FC = ({ summaries }) => { diff --git a/frontend-react/src/components/plus/VotingHistoryPage.tsx b/frontend-react/src/components/plus/VotingHistoryPage.tsx index 98d5522bb..d7e293722 100644 --- a/frontend-react/src/components/plus/VotingHistoryPage.tsx +++ b/frontend-react/src/components/plus/VotingHistoryPage.tsx @@ -20,7 +20,7 @@ export interface Summary { discord_id: string username: string discriminator: string - twitter_name: string + avatar?: string } score: { total: number @@ -131,21 +131,21 @@ const VotingHistoryPage: React.FC = () => { { label: "+2", value: "+2" }, ]} value={forms.plus_server} - setValue={value => setForms({ ...forms, plus_server: value })} + setValue={(value) => setForms({ ...forms, plus_server: value })} /> )}