X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fresults%2FDetailDialog.js;h=a914f5d0e134926dd5fd47f654795cc45fe6209c;hb=3a069159f7971758817bb281f72a41ddc7d7a958;hp=368575bd359013d739e87b9c4ca593e5deff562e;hpb=8d97d023740e438361e659c6e133418e33343178;p=alttp.git diff --git a/resources/js/components/results/DetailDialog.js b/resources/js/components/results/DetailDialog.js index 368575b..a914f5d 100644 --- a/resources/js/components/results/DetailDialog.js +++ b/resources/js/components/results/DetailDialog.js @@ -5,8 +5,8 @@ import { withTranslation } from 'react-i18next'; import Box from '../users/Box'; import { getTime } from '../../helpers/Result'; -import { findResult } from '../../helpers/Participant'; import { maySeeResults } from '../../helpers/permissions'; +import { findResult } from '../../helpers/User'; import { withUser } from '../../helpers/UserContext'; import i18n from '../../i18n'; @@ -14,15 +14,15 @@ const getPlacement = result => `${result.placement}. (${i18n.t('results.points', { count: result.score })})`; const DetailDialog = ({ + authUser, onHide, - participant, round, show, tournament, user, }) => { - const result = findResult(participant, round); - const maySee = maySeeResults(user, tournament, round); + const result = findResult(user, round); + const maySee = maySeeResults(authUser, tournament, round); return @@ -41,7 +41,7 @@ const DetailDialog = ({ {i18n.t('results.runner')} -
+
{i18n.t('results.result')} @@ -76,11 +76,9 @@ const DetailDialog = ({ }; DetailDialog.propTypes = { - onHide: PropTypes.func, - participant: PropTypes.shape({ - user: PropTypes.shape({ - }), + authUser: PropTypes.shape({ }), + onHide: PropTypes.func, round: PropTypes.shape({ created_at: PropTypes.string, number: PropTypes.number, @@ -92,4 +90,4 @@ DetailDialog.propTypes = { }), }; -export default withTranslation()(withUser(DetailDialog)); +export default withTranslation()(withUser(DetailDialog, 'authUser'));