X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Frounds%2FItem.js;h=c4e337419df5b12e469b989b2b51ba750312fe86;hb=c59d0714d62f9028135cc9cff829d16b91e5fb4f;hp=064c7dc992ead951105c661cd9dd861b3a557f69;hpb=edd0e97bfdc544114f30bf4c13a929631c44a555;p=alttp.git diff --git a/resources/js/components/rounds/Item.js b/resources/js/components/rounds/Item.js index 064c7dc..c4e3374 100644 --- a/resources/js/components/rounds/Item.js +++ b/resources/js/components/rounds/Item.js @@ -3,11 +3,27 @@ import React from 'react'; import { withTranslation } from 'react-i18next'; import List from '../results/List'; +import ReportButton from '../results/ReportButton'; +import { isParticipant } from '../../helpers/permissions'; +import { findParticipant } from '../../helpers/Tournament'; +import { withUser } from '../../helpers/UserContext'; import i18n from '../../i18n'; -const Item = ({ round, tournament }) =>
  • -
    - {i18n.t('rounds.date', { date: new Date(round.created_at) })} +const Item = ({ + round, + tournament, + user, +}) => +
  • +
    +

    {i18n.t('rounds.date', { date: new Date(round.created_at) })}

    + {isParticipant(user, tournament) ? + + : null}
  • ; @@ -20,6 +36,8 @@ Item.propTypes = { participants: PropTypes.arrayOf(PropTypes.shape({ })), }), + user: PropTypes.shape({ + }), }; -export default withTranslation()(Item); +export default withTranslation()(withUser(Item));