From 386332497e54ff7167c77e686112c8582f6cc076 Mon Sep 17 00:00:00 2001 From: Hubert Walczak Date: Mon, 2 Nov 2020 10:44:25 +0100 Subject: [PATCH] Added svg support --- src/HUD/MatchBar/TeamLogo.tsx | 14 +++++++++++--- src/HUD/MatchBar/TeamScore.tsx | 3 ++- src/HUD/Players/Observed.tsx | 4 ++-- src/HUD/Players/Player.tsx | 2 +- src/HUD/Styles/match.css | 1 + 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/HUD/MatchBar/TeamLogo.tsx b/src/HUD/MatchBar/TeamLogo.tsx index 54ecb87..53a40e5 100644 --- a/src/HUD/MatchBar/TeamLogo.tsx +++ b/src/HUD/MatchBar/TeamLogo.tsx @@ -1,14 +1,22 @@ import React from 'react'; import { Team } from 'csgogsi-socket'; import * as I from '../../api/interfaces'; - +import { apiUrl } from './../../api/api'; export default class TeamLogo extends React.Component<{ team?: Team | I.Team | null, height?: number, width?: number}> { render(){ - if(!this.props.team) return null; + const { team } = this.props; + if(!team) return null; + let id = ''; + const { logo } = team; + if('_id' in team){ + id = team._id; + } else if('id' in team && team.id){ + id = team.id; + } return (
- { this.props.team.logo ? {'Team : ''} + { logo && id ? {'Team : ''}
); } diff --git a/src/HUD/MatchBar/TeamScore.tsx b/src/HUD/MatchBar/TeamScore.tsx index 1c896b6..4e7c718 100644 --- a/src/HUD/MatchBar/TeamScore.tsx +++ b/src/HUD/MatchBar/TeamScore.tsx @@ -2,6 +2,7 @@ import React from "react"; import * as I from "csgogsi-socket"; import WinIndicator from "./WinIndicator"; import { Timer } from "./MatchBar"; +import TeamLogo from './TeamLogo'; import PlantDefuse from "../Timers/PlantDefuse" interface IProps { @@ -18,7 +19,7 @@ export default class TeamScore extends React.Component { <>
{team.name}
-
{team.logo ? {'Team : ""}
+
diff --git a/src/HUD/Players/Observed.tsx b/src/HUD/Players/Observed.tsx index 6353bdf..ffd906c 100644 --- a/src/HUD/Players/Observed.tsx +++ b/src/HUD/Players/Observed.tsx @@ -57,8 +57,8 @@ export default class Observed extends React.Component<{ player: Player | null, v return (
- - + +
{player.name}
{player.realName}
diff --git a/src/HUD/Players/Player.tsx b/src/HUD/Players/Player.tsx index 125f529..d9702d2 100644 --- a/src/HUD/Players/Player.tsx +++ b/src/HUD/Players/Player.tsx @@ -22,7 +22,7 @@ export default class PlayerBox extends React.Component { return (
- +
K
diff --git a/src/HUD/Styles/match.css b/src/HUD/Styles/match.css index 554ac0c..9ce5f42 100644 --- a/src/HUD/Styles/match.css +++ b/src/HUD/Styles/match.css @@ -33,6 +33,7 @@ } .map_series_container .veto_container div img { max-height:30px; + max-width: 30px; } .map_series_container .veto_container .veto_picker, .map_series_container .veto_container .veto_winner { width: 77px;