Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed pfp's not showing up in scoreboard #1

Merged
merged 2 commits into from
Jul 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/components/TF2/Player/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,18 @@ function displayProperStatus(status: string) {
interface Player {
player: PlayerInfo;
icon?: string;
pfp?: string;
className?: string;
}

const Player = ({ player, icon, pfp, className }: Player) => {
const Player = ({ player, icon, className }: Player) => {
// Use "Player" as a verdict if the client isnt You
const displayVerdict = player.isSelf
? 'You'
: displayProperVerdict(player.verdict ?? 'Player');
const displayTime = formatTime(player.gameInfo?.time!);
const displayStatus = displayProperStatus(player.gameInfo!.state!);
const pfp = player.steamInfo?.pfp ??
'https://cdn.discordapp.com/icons/1112665618869661726/d6a0255dfca479cbde6707908fbc9a2a.webp'

return (
<Flex className={`player-item ${className}`}>
Expand All @@ -79,10 +80,7 @@ const Player = ({ player, icon, pfp, className }: Player) => {
className="player-pfp"
width={24}
height={24}
src={
pfp ??
'https://cdn.discordapp.com/icons/1112665618869661726/d6a0255dfca479cbde6707908fbc9a2a.webp'
}
src={pfp}
alt="Profile"
/>
<div className="player-name">{player.name}</div>
Expand Down