X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Frounds%2FItem.js;h=817069f98dc1fb7552188ed0cbfcb80a9d326dcd;hb=5dc7faa01ad96732b0ea126e945f215a9d0490af;hp=52b989d7a4aac04e484022103b6b6c86139570b4;hpb=a4260a00251cef4ad806c9d5c44d4c444d6ab831;p=alttp.git diff --git a/resources/js/components/rounds/Item.js b/resources/js/components/rounds/Item.js index 52b989d..817069f 100644 --- a/resources/js/components/rounds/Item.js +++ b/resources/js/components/rounds/Item.js @@ -2,20 +2,21 @@ import PropTypes from 'prop-types'; import React from 'react'; import { withTranslation } from 'react-i18next'; +import EditButton from './EditButton'; import LockButton from './LockButton'; import SeedButton from './SeedButton'; import SeedCode from './SeedCode'; +import SeedRolledBy from './SeedRolledBy'; import List from '../results/List'; import ReportButton from '../results/ReportButton'; -import { isParticipant, isRunner } from '../../helpers/permissions'; +import { mayEditRound, mayReportResult, isRunner } from '../../helpers/permissions'; import { isComplete } from '../../helpers/Round'; -import { findParticipant } from '../../helpers/Tournament'; import { hasFinishedRound } from '../../helpers/User'; import { withUser } from '../../helpers/UserContext'; import i18n from '../../i18n'; const getClassName = (round, tournament, user) => { - const classNames = ['round', 'd-flex']; + const classNames = ['round']; if (round.locked) { classNames.push('is-locked'); } else { @@ -40,48 +41,68 @@ const Item = ({ user, }) =>
- {round.number ? `#${round.number} ` : '#?'} - {i18n.t('rounds.date', { date: new Date(round.created_at) })} -
-
- {round.code ?
- <>
-
-
+ {round.number ? `#${round.number} ` : '#?'}
+ {i18n.t('rounds.date', { date: new Date(round.created_at) })}
+
+ {round.code && round.code.length ?
+ <>
+
+ {i18n.t('rounds.numberOfResults', { count: round.results.length })}
+ >
+ : null}
+
;
Item.propTypes = {
round: PropTypes.shape({
code: PropTypes.arrayOf(PropTypes.string),
created_at: PropTypes.string,
+ game: PropTypes.string,
locked: PropTypes.bool,
number: PropTypes.number,
+ results: PropTypes.arrayOf(PropTypes.shape({
+ })),
seed: PropTypes.string,
+ title: PropTypes.string,
}),
tournament: PropTypes.shape({
participants: PropTypes.arrayOf(PropTypes.shape({
})),
+ type: PropTypes.string,
}),
user: PropTypes.shape({
}),