X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=resources%2Fjs%2Fcomponents%2Ftournament%2FScoreboard.js;h=27bb0873a4d7c75d4de6a3b15f25f1d514a07713;hb=9a4e2305bb37cb8c62e3ad332f4a2bf45f720a18;hp=cbc73a32620db88204b5fa81f669a5db18c79702;hpb=5dacd7900839a5e270de87de8c4f51dea385c1f0;p=alttp.git
diff --git a/resources/js/components/tournament/Scoreboard.js b/resources/js/components/tournament/Scoreboard.js
index cbc73a3..27bb087 100644
--- a/resources/js/components/tournament/Scoreboard.js
+++ b/resources/js/components/tournament/Scoreboard.js
@@ -1,77 +1,106 @@
import PropTypes from 'prop-types';
import React from 'react';
import { Button, Table } from 'react-bootstrap';
-import { withTranslation } from 'react-i18next';
+import { useTranslation } from 'react-i18next';
import Icon from '../common/Icon';
import Box from '../users/Box';
-import { calculateScores } from '../../helpers/Tournament';
-import { withUser } from '../../helpers/UserContext';
-import i18n from '../../i18n';
+import { comparePlacement } from '../../helpers/Participant';
+import { getRunners } from '../../helpers/Tournament';
+import { useUser } from '../../hooks/user';
-const getRowClassName = (tournament, score, user) => {
+const getRowClassName = (tournament, participant, user) => {
const classNames = ['score'];
- if (score && user && score.participant && score.participant.user_id == user.id) {
+ if (participant && user && participant.user_id == user.id) {
classNames.push('is-self');
}
return classNames.join(' ');
};
-const getPlacementDisplay = score => {
- if (score.placement === 1) {
+const getPlacementDisplay = participant => {
+ if (participant.placement === 1) {
return
{i18n.t('participants.placementShort')} | -{i18n.t('participants.participant')} | -{i18n.t('participants.scoreShort')} | -
---|---|---|
- {getPlacementDisplay(score)} - | -
-
-
- |
- {score.score} | -
{t('participants.placementShort')} | +{t('participants.participant')} | +{t('participants.scoreShort')} | +
---|---|---|
+ {getPlacementDisplay(participant)} + | +
+
+
+ |
+ {participant.score} | +