diff --git a/app/src/api/helper/api.types.ts b/app/src/api/helper/api.types.ts index 480ef82f..74b4f3c7 100644 --- a/app/src/api/helper/api.types.ts +++ b/app/src/api/helper/api.types.ts @@ -162,9 +162,25 @@ export interface IProfileResult { country: string; countryIcon: string; verified: boolean; + shared: boolean; leaderboards: IProfileLeaderboardResult[]; ratings: IProfileRatingsLeaderboard[]; stats: IStatNew[]; + linkedProfiles: ILinkedProfile[]; +} + +interface ILinkedProfile { + profileId: number + steamId: any + name: string + country: any + games: number + drops: number + clan: any + avatarhash: any + hidden: any + verified: boolean + shared: boolean } @@ -315,6 +331,7 @@ export interface IPlayerNew { won?: boolean replay?: boolean verified: boolean + shared?: boolean } diff --git a/app/src/changelog.ts b/app/src/changelog.ts index 8059a080..8519eb1f 100644 --- a/app/src/changelog.ts +++ b/app/src/changelog.ts @@ -174,10 +174,18 @@ export const changelog4: IChangelog = { }; export const changelog: IChangelog = { + '117.0.0': [ + { + type: 'feature', + title: 'Steam Family Sharing Indicator', + content: 'Show family icon next to player in match popup and on profile', + }, + ], '116.0.0': [ { type: 'minor', - title: 'Check for update in play store / app store on startup and show a message if an update is available', + title: 'Check for update in play store / app store', + content: 'Check for update on startup and show a popup if an update is available', }, ], '115.0.0': [ diff --git a/app/src/components/match/player.tsx b/app/src/components/match/player.tsx index 3e258b6c..62815bf2 100644 --- a/app/src/components/match/player.tsx +++ b/app/src/components/match/player.tsx @@ -74,6 +74,7 @@ export const MatchPlayer: React.FC = ({ match, player, highlig )} + {player.status === 0 && !isVerifiedPlayer(player.profileId) && player.shared && } diff --git a/app/src/view/components/profile.tsx b/app/src/view/components/profile.tsx index 1d068daa..8e01fd7f 100644 --- a/app/src/view/components/profile.tsx +++ b/app/src/view/components/profile.tsx @@ -1,7 +1,13 @@ import { useTournamentPlayer } from '@app/api/tournaments'; import { Button } from '@app/components/button'; -import { FontAwesome5 } from '@expo/vector-icons'; -import { getDiscordInvitationId, getDoyouChannel, getTwitchChannel, getVerifiedPlayer, getYoutubeChannel } from '@nex/data'; +import { FontAwesome5, FontAwesome6 } from '@expo/vector-icons'; +import { + getDiscordInvitationId, + getDoyouChannel, + getTwitchChannel, + getVerifiedPlayer, + getYoutubeChannel, +} from '@nex/data'; import { Image, ImageStyle } from 'expo-image'; import React, { useEffect, useState } from 'react'; import { StyleSheet, TouchableOpacity, View } from 'react-native'; @@ -26,6 +32,9 @@ import { usePaperTheme } from '../../theming'; import { createStylesheet } from '../../theming-new'; import { TournamentPlayerPopup } from '../tournaments/player-popup'; import { TournamentMarkdown } from '../tournaments/tournament-markdown'; +import { Icon } from '@app/components/icon'; +import { FontAwesomeIconStyle } from '@fortawesome/react-native-fontawesome'; +import { Link } from 'expo-router'; interface ILeaderboardRowProps { data: IProfileLeaderboardResult; @@ -185,11 +194,11 @@ export default function Profile({ data, ready }: IProfileProps) { } }, [data]); - // console.log('DATA===>', data); + // console.log('verifiedPlayer===>', verifiedPlayer); return ( - + {/**/} @@ -197,7 +206,8 @@ export default function Profile({ data, ready }: IProfileProps) { {data?.name} - {data?.verified && } + {data?.verified && } + {!data?.verified && data?.shared && } {!!data?.clan && ( {' '} @@ -228,30 +238,31 @@ export default function Profile({ data, ready }: IProfileProps) { - - - - {verifiedPlayer?.discord && ( - - - - )} - {verifiedPlayer?.youtube && ( - - - - )} - {verifiedPlayer?.douyu && ( - - - - )} - {verifiedPlayer?.twitch != null && ( - - - - )} - + { + (verifiedPlayer?.discord || verifiedPlayer?.youtube || verifiedPlayer?.douyu || verifiedPlayer?.twitch != null) && + + {verifiedPlayer?.discord && ( + + + + )} + {verifiedPlayer?.youtube && ( + + + + )} + {verifiedPlayer?.douyu && ( + + + + )} + {verifiedPlayer?.twitch != null && ( + + + + )} + + } {liquipediaProfile && ( @@ -270,67 +281,101 @@ export default function Profile({ data, ready }: IProfileProps) { )} - + + Linked + { + data?.linkedProfiles?.map((data) => ( + + + + + {data?.name} + {data?.verified && } + {!data?.verified && data?.shared && } + {!!data?.clan && ( + + {' '} + ({getTranslation('main.profile.clan')}: {data?.clan}) + + )} + + + )) + } + - - - {getTranslation('main.profile.heading.board')} - - - {getTranslation('main.profile.heading.rank')} - - - {getTranslation('main.profile.heading.rating')} - - - {getTranslation('main.profile.heading.max')} - - - {getTranslation('main.profile.heading.change')} - + { + !data?.verified && data?.shared && + + + Steam Family Sharing + + + } + + + + + {getTranslation('main.profile.heading.board')} + + + {getTranslation('main.profile.heading.rank')} + + + {getTranslation('main.profile.heading.rating')} + + + {getTranslation('main.profile.heading.max')} + + + {getTranslation('main.profile.heading.change')} + + + {data?.leaderboards.map((leaderboard) => )} + + {!data && + Array(2) + .fill(0) + .map((a, i) => ( + + + + + + + + ))} - {data?.leaderboards.map((leaderboard) => )} - - {!data && - Array(2) - .fill(0) - .map((a, i) => ( - - - - - - - - ))} - - - - {getTranslation('main.profile.heading.board')} - - - {getTranslation('main.profile.heading.games')} - - - {getTranslation('main.profile.heading.won')} - - - {getTranslation('main.profile.heading.streak')} - + + + + + {getTranslation('main.profile.heading.board')} + + + {getTranslation('main.profile.heading.games')} + + + {getTranslation('main.profile.heading.won')} + + + {getTranslation('main.profile.heading.streak')} + + + {data?.leaderboards.map((leaderboard) => )} + + {!data && + Array(2) + .fill(0) + .map((a, i) => ( + + + + + + + ))} - {data?.leaderboards.map((leaderboard) => )} - - {!data && - Array(2) - .fill(0) - .map((a, i) => ( - - - - - - - ))} ); diff --git a/data/src/helper/reference.ts b/data/src/helper/reference.ts index 7b24e720..6b2833ab 100644 --- a/data/src/helper/reference.ts +++ b/data/src/helper/reference.ts @@ -56,8 +56,9 @@ export function isVerifiedPlayer(profileId: number) { } export function getVerifiedPlayer(profileId: number) { - // console.log(profileId, verifiedPlayer); - return aoeReferenceDataTyped.players?.find((p) => p.platforms?.rl?.includes(profileId.toString())); + // console.log(profileId); + // console.log(aoeReferenceDataTyped.players); + return aoeReferenceDataTyped.players?.find((p) => p.platforms?.rl?.some(rl => rl.includes(profileId.toString()))); } export function getVerifiedPlayerBy(predicate: (value: IReferencePlayer, index: number) => unknown) {