X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Ftournament%2FDetail.js;h=5b8e7804a5e45e0006c27a4f9bdae44d985bff33;hb=d1f28ea443b090c7593791eba9631796ccaeafe1;hp=60c9d245716439653296fea58decc6659f4b8ae8;hpb=edd0e97bfdc544114f30bf4c13a929631c44a555;p=alttp.git diff --git a/resources/js/components/tournament/Detail.js b/resources/js/components/tournament/Detail.js index 60c9d24..5b8e780 100644 --- a/resources/js/components/tournament/Detail.js +++ b/resources/js/components/tournament/Detail.js @@ -1,11 +1,21 @@ import PropTypes from 'prop-types'; import React from 'react'; -import { Button, Container } from 'react-bootstrap'; +import { Button, Col, Container, Row } from 'react-bootstrap'; import { withTranslation } from 'react-i18next'; -import Participants from '../participants/List'; +import Scoreboard from './Scoreboard'; +import Protocol from '../protocol/Protocol'; import Rounds from '../rounds/List'; -import { mayAddRounds } from '../../helpers/permissions'; +import Box from '../users/Box'; +import { + mayAddRounds, + mayViewProtocol, +} from '../../helpers/permissions'; +import { + getTournamentAdmins, + hasRunners, + hasTournamentAdmins, +} from '../../helpers/Tournament'; import { withUser } from '../../helpers/UserContext'; import i18n from '../../i18n'; @@ -13,32 +23,56 @@ const Detail = ({ addRound, tournament, user, -}) => -
-

{tournament.title}

-
-
-

{i18n.t('participants.heading')}

-
- {tournament.participants ? - - : null} -
-

{i18n.t('rounds.heading')}

- {addRound && mayAddRounds(user, tournament) ? - - : null} -
- {tournament.rounds ? - - : null} +}) => + + +
+

{tournament.title}

+ {mayViewProtocol(user, tournament) ? + + : null} +
+ +
+ + +
+

{i18n.t('tournaments.scoreboard')}

+
+ {hasRunners(tournament) ? + + : null} + {hasTournamentAdmins(tournament) ? + <> +
+

{i18n.t('tournaments.admins')}

+
+ {getTournamentAdmins(tournament).map(p => +

+ )} + + : null} + + +
+

{i18n.t('rounds.heading')}

+ {addRound && mayAddRounds(user, tournament) ? + + : null} +
+ {tournament.rounds ? + + : null} + +
; Detail.propTypes = { addRound: PropTypes.func, tournament: PropTypes.shape({ + id: PropTypes.number, participants: PropTypes.arrayOf(PropTypes.shape({ })), rounds: PropTypes.arrayOf(PropTypes.shape({