]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/rounds/Item.js
switch participant list to scoreboard
[alttp.git] / resources / js / components / rounds / Item.js
index b227e9334798ffe89dae08775a3098458b47a8b1..1832edb4c13bb5e08f90f1731f1866884ffcd452 100644 (file)
@@ -3,28 +3,32 @@ import React from 'react';
 import { Button } from 'react-bootstrap';
 import { withTranslation } from 'react-i18next';
 
+import SeedButton from './SeedButton';
 import List from '../results/List';
 import ReportButton from '../results/ReportButton';
-import { isParticipant } from '../../helpers/permissions';
+import { maySetSeed, isParticipant } from '../../helpers/permissions';
 import { findParticipant } from '../../helpers/Tournament';
 import { withUser } from '../../helpers/UserContext';
 import i18n from '../../i18n';
 
 const Item = ({
+       index,
        round,
        tournament,
        user,
 }) =>
 <li className="round d-flex">
        <div className="info">
-               <p className="date">{i18n.t('rounds.date', { date: new Date(round.created_at) })}</p>
-               {round.seed ?
-                       <p className="seed">
-                               <Button href={round.seed} target="_blank" variant="primary">
-                                       {i18n.t('rounds.seed')}
-                               </Button>
-                       </p>
-               : null}
+               <p className="date">
+                       {`#${index + 1} `}
+                       {i18n.t('rounds.date', { date: new Date(round.created_at) })}
+               </p>
+               <p className="seed">
+                       <SeedButton
+                               round={round}
+                               tournament={tournament}
+                       />
+               </p>
                {isParticipant(user, tournament) ?
                        <p className="report">
                                <ReportButton
@@ -39,6 +43,7 @@ const Item = ({
 </li>;
 
 Item.propTypes = {
+       index: PropTypes.number,
        round: PropTypes.shape({
                created_at: PropTypes.string,
                seed: PropTypes.string,