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

Add default CT/T team logo if no custom logos are present #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion src/HUD/MatchBar/TeamLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { Team } from 'csgogsi-socket';
import * as I from '../../api/interfaces';
import { apiUrl } from './../../api/api';
import { LogoCT, LogoT } from './../../assets/Icons';

export default class TeamLogo extends React.Component<{ team?: Team | I.Team | null, height?: number, width?: number}> {
render(){
Expand All @@ -16,7 +17,7 @@ export default class TeamLogo extends React.Component<{ team?: Team | I.Team | n
}
return (
<div className={`logo`}>
{ logo && id ? <img src={`${apiUrl}api/teams/logo/${id}`} width={this.props.width} height={this.props.height} alt={'Team logo'} /> : ''}
<img src={logo && id ? `${apiUrl}api/teams/logo/${id}` : ("side" in team && team.side === "CT" ? LogoCT : LogoT)} width={this.props.width} height={this.props.height} alt={'Team logo'} />
</div>
);
}
Expand Down