From 4b2cfa6f0f0bb20934f0a274343dec112f0225df Mon Sep 17 00:00:00 2001 From: Chris Blanchard Date: Sun, 20 Sep 2015 14:50:59 +0100 Subject: [PATCH] Standardise vote action width --- lib/react/gather.jsx | 27 ++++++++++++++------------- public/css/app.css | 4 ++++ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/lib/react/gather.jsx b/lib/react/gather.jsx index 9d2a21c..080dc14 100644 --- a/lib/react/gather.jsx +++ b/lib/react/gather.jsx @@ -389,14 +389,14 @@ var VoteButton = React.createClass({ return ( ); } else { return ( ); @@ -671,27 +671,28 @@ var Gatherers = React.createClass({ alt={gatherer.user.country} />); }; - var skill = gatherer.user.profile.skill || "Not Available"; + let skill = gatherer.user.profile.skill || "Not Available"; - var abilities = []; - for (let attr in gatherer.user.profile.abilities) { - if (gatherer.user.profile.abilities[attr]) abilities.push(_.capitalize(attr)); + let lifeform; + let abilities = gatherer.user.profile.abilities; + if (abilities.length) { + lifeform = abilities.map(ability => {return _.capitalize(ability)}).join(", "); + } else { + lifeform = "None Specified"; } - var lifeform = (abilities.length) ? abilities.join(", ") : "None Specified"; - - var hiveStats = []; + let hiveStats = []; if (gatherer.user.hive.skill) hiveStats.push(`${gatherer.user.hive.skill} ELO`); if (gatherer.user.hive.playTime) { hiveStats.push(`${Math.floor(gatherer.user.hive.playTime / 3600)} Hours`); } - var hive = (hiveStats.length) ? hiveStats.join(", ") : "Not Available"; + let hive = (hiveStats.length) ? hiveStats.join(", ") : "Not Available"; - var team = (gatherer.user.team) ? gatherer.user.team.name : "None"; + let team = (gatherer.user.team) ? gatherer.user.team.name : "None"; - var action; + let action; if (self.props.gather.state === "election") { var votes = self.props.gather.gatherers.reduce((acc, voter) => { if (voter.leaderVote === gatherer.id) acc++; @@ -718,7 +719,7 @@ var Gatherers = React.createClass({ if (gatherer.leader) { action = (Leader); } else if (gatherer.team !== "lobby") { - action = ({gatherer.team}); + action = ({_.capitalize(gatherer.team)}); } } } diff --git a/public/css/app.css b/public/css/app.css index 9730c5d..3d7b96b 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -127,3 +127,7 @@ html, body { .panel-light-background { background-color: #d9edf7; } + +.vote-button { + min-width: 60px; +} \ No newline at end of file