X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Frounds%2FLockButton.js;h=c29b3d3f7412ecd8b53ca9add6695289e06026ef;hb=1f91cd54bca46f686aaed871c9a7a7d000179ee0;hp=38411ebb0b1b83d27c13f9927fdb21943fe33b1e;hpb=17847098a56367f0c11bfc2197a6c7b453d2fa4a;p=alttp.git
diff --git a/resources/js/components/rounds/LockButton.js b/resources/js/components/rounds/LockButton.js
index 38411eb..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 ;
}
}
@@ -34,7 +35,7 @@ const LockButton = ({