From 95a442a5756183f7ad5fc1bc776e9ae4e813b742 Mon Sep 17 00:00:00 2001 From: Ahiya Elster Date: Fri, 15 Nov 2019 12:13:56 +0200 Subject: [PATCH 1/2] Added roles for players --- src/components/Match/matchColumns.jsx | 1 + src/components/Visualizations/Table/HeroImage.jsx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/components/Match/matchColumns.jsx b/src/components/Match/matchColumns.jsx index 66c99d7fd6..7f8f79de4c 100644 --- a/src/components/Match/matchColumns.jsx +++ b/src/components/Match/matchColumns.jsx @@ -56,6 +56,7 @@ export default (strings) => { predictedVictory={row.pred_vict} leaverStatus={row.leaver_status} hero={compileLevelOneStats(heroes[row.hero_id])} + role={row.desc} />); }; diff --git a/src/components/Visualizations/Table/HeroImage.jsx b/src/components/Visualizations/Table/HeroImage.jsx index 0326d41455..6ab7ac40b5 100644 --- a/src/components/Visualizations/Table/HeroImage.jsx +++ b/src/components/Visualizations/Table/HeroImage.jsx @@ -481,6 +481,7 @@ class TableHeroImage extends React.Component { leaverStatus, strings, hero = {}, + role, } = this.props; const { tooltipVisible } = this.state; @@ -576,6 +577,7 @@ class TableHeroImage extends React.Component { : title} + {role} {subtitle && {subtitle} @@ -724,6 +726,7 @@ TableHeroImage.propTypes = { strings: shape({}), hero: shape({}), heroID: number, + role: string, }; // If need party or estimated, just add new prop with default val = solo and change icons depending what needs From 0671fd06e180eda66e9c3ec7490efd2a0ef702bc Mon Sep 17 00:00:00 2001 From: Ahiya Elster Date: Fri, 15 Nov 2019 12:17:28 +0200 Subject: [PATCH 2/2] only render if defined --- src/components/Visualizations/Table/HeroImage.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Visualizations/Table/HeroImage.jsx b/src/components/Visualizations/Table/HeroImage.jsx index 6ab7ac40b5..2f65732a14 100644 --- a/src/components/Visualizations/Table/HeroImage.jsx +++ b/src/components/Visualizations/Table/HeroImage.jsx @@ -577,7 +577,7 @@ class TableHeroImage extends React.Component { : title} - {role} + {role && {role}} {subtitle && {subtitle}