mirror of
https://github.com/lexogrine/cs2-react-hud.git
synced 2025-12-10 03:52:48 +01:00
Show default CT/T team logo if no custom logo is present
This commit is contained in:
parent
656fce7e4f
commit
68ec8960ab
@ -1,6 +1,7 @@
|
||||
import { Team } from 'csgogsi';
|
||||
import * as I from '../../API/types';
|
||||
import { apiUrl } from './../../API';
|
||||
import { LogoCT, LogoT } from './../../assets/Icons';
|
||||
|
||||
const TeamLogo = ({team, height, width }: { team?: Team | I.Team | null, height?: number, width?: number}) => {
|
||||
if(!team) return null;
|
||||
@ -13,7 +14,7 @@ const TeamLogo = ({team, height, width }: { team?: Team | I.Team | null, height?
|
||||
}
|
||||
return (
|
||||
<div className={`logo`}>
|
||||
{ logo && id ? <img src={`${apiUrl}api/teams/logo/${id}`} width={width} height={height} alt={'Team logo'} /> : ''}
|
||||
<img src={logo && id ? `${apiUrl}api/teams/logo/${id}` : ('side' in team && team.side === "CT" ? LogoCT : LogoT)} width={width} height={height} alt={'Team logo'} />
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user