mirror of
https://github.com/lexogrine/cs2-react-hud.git
synced 2025-12-10 02:42:49 +01:00
Merge pull request #2 from borzaka/patch-1
Show default CT/T team logo if no custom logo is present
This commit is contained in:
commit
8ad1a9410b
@ -1,6 +1,7 @@
|
|||||||
import { Team } from 'csgogsi';
|
import { Team } from 'csgogsi';
|
||||||
import * as I from '../../API/types';
|
import * as I from '../../API/types';
|
||||||
import { apiUrl } from './../../API';
|
import { apiUrl } from './../../API';
|
||||||
|
import { LogoCT, LogoT } from './../../assets/Icons';
|
||||||
|
|
||||||
const TeamLogo = ({team, height, width }: { team?: Team | I.Team | null, height?: number, width?: number}) => {
|
const TeamLogo = ({team, height, width }: { team?: Team | I.Team | null, height?: number, width?: number}) => {
|
||||||
if(!team) return null;
|
if(!team) return null;
|
||||||
@ -13,10 +14,10 @@ const TeamLogo = ({team, height, width }: { team?: Team | I.Team | null, height?
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className={`logo`}>
|
<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>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TeamLogo;
|
export default TeamLogo;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user