X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Frounds%2FLockButton.js;h=c29b3d3f7412ecd8b53ca9add6695289e06026ef;hb=167f986f468014e00d82fa2df8193f6be8dca19d;hp=a7a60fb1ae44ef1026269bb604027e7dc1b7b9c4;hpb=d1f28ea443b090c7593791eba9631796ccaeafe1;p=alttp.git
diff --git a/resources/js/components/rounds/LockButton.js b/resources/js/components/rounds/LockButton.js
index a7a60fb..c29b3d3 100644
--- a/resources/js/components/rounds/LockButton.js
+++ b/resources/js/components/rounds/LockButton.js
@@ -1,26 +1,27 @@
import PropTypes from 'prop-types';
import React, { useState } from 'react';
import { Button } from 'react-bootstrap';
-import { withTranslation } from 'react-i18next';
+import { useTranslation } from 'react-i18next';
import LockDialog from './LockDialog';
import Icon from '../common/Icon';
import { mayLockRound } from '../../helpers/permissions';
-import { withUser } from '../../helpers/UserContext';
-import i18n from '../../i18n';
+import { useUser } from '../../hooks/user';
const LockButton = ({
round,
tournament,
- user,
}) => {
const [showDialog, setShowDialog] = useState(false);
+ const { t } = useTranslation();
+ const { user } = useUser();
+
if (!mayLockRound(user, tournament, round)) {
if (round.locked) {
- return ;
+ return ;
} else {
- return ;
+ return ;
}
}
@@ -29,11 +30,12 @@ const LockButton = ({
onHide={() => setShowDialog(false)}
round={round}
show={showDialog}
+ tournament={tournament}
/>