]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/tournament/Scoreboard.js
add user stream links
[alttp.git] / resources / js / components / tournament / Scoreboard.js
index 008974b7cc76ce1b8f362707f0dfb6fdcead4ee0..e142a80e030488f9a96d474d31d390b9a5259617 100644 (file)
@@ -1,8 +1,9 @@
 import PropTypes from 'prop-types';
 import React from 'react';
-import { Table } from 'react-bootstrap';
+import { Button, Table } from 'react-bootstrap';
 import { withTranslation } from 'react-i18next';
 
+import Icon from '../common/Icon';
 import Box from '../users/Box';
 import { calculateScores } from '../../helpers/Tournament';
 import i18n from '../../i18n';
@@ -18,7 +19,22 @@ const Scoreboard = ({ tournament }) =>
        <tbody>
        {calculateScores(tournament).map(score =>
                <tr className="score" key={score.participant.id}>
-                       <td><Box user={score.participant.user} /></td>
+                       <td>
+                               <div className="d-flex align-items-center justify-content-between">
+                                       <Box user={score.participant.user} />
+                                       {score.participant.user.stream_link ?
+                                               <Button
+                                                       href={score.participant.user.stream_link}
+                                                       size="sm"
+                                                       target="_blank"
+                                                       title={i18n.t('users.stream')}
+                                                       variant="outline-twitch"
+                                               >
+                                                       <Icon.STREAM title="" />
+                                               </Button>
+                                       : null}
+                               </div>
+                       </td>
                        <td className="text-end text-lg">{score.score}</td>
                </tr>
        )}