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';
`${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 <Modal className="result-dialog" onHide={onHide} show={show}>
<Modal.Header closeButton>
<Modal.Title>
</Form.Group>
<Form.Group as={Col} sm={6}>
<Form.Label>{i18n.t('results.runner')}</Form.Label>
- <div><Box user={participant.user} /></div>
+ <div><Box user={user} /></div>
</Form.Group>
<Form.Group as={Col} sm={6}>
<Form.Label>{i18n.t('results.result')}</Form.Label>
};
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,
}),
};
-export default withTranslation()(withUser(DetailDialog));
+export default withTranslation()(withUser(DetailDialog, 'authUser'));