X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fapplications%2FButton.js;h=2361b09107b00a081aa1b5484e9d9d41866d03af;hb=4c5a82cb876e96c72c50e8bc12bd8a43a9afe847;hp=415042b6da6c58d0a5b7d46ee3b8577745188645;hpb=1e725fef6dc440aaeea8c30e1e0598dc5d24ad86;p=alttp.git diff --git a/resources/js/components/applications/Button.js b/resources/js/components/applications/Button.js index 415042b..2361b09 100644 --- a/resources/js/components/applications/Button.js +++ b/resources/js/components/applications/Button.js @@ -1,17 +1,19 @@ import PropTypes from 'prop-types'; -import React, { useState } from 'react'; +import React from 'react'; import { Badge, Button } from 'react-bootstrap'; -import { withTranslation } from 'react-i18next'; +import { useTranslation } from 'react-i18next'; import Dialog from './Dialog'; import Icon from '../common/Icon'; import { mayHandleApplications } from '../../helpers/permissions'; import { getPendingApplications } from '../../helpers/Tournament'; -import { withUser } from '../../helpers/UserContext'; -import i18n from '../../i18n'; +import { useUser } from '../../hooks/user'; -const ApplicationsButton = ({ tournament, user }) => { - const [showDialog, setShowDialog] = useState(false); +const ApplicationsButton = ({ tournament }) => { + const [showDialog, setShowDialog] = React.useState(false); + + const { t } = useTranslation(); + const { user } = useUser(); if (!user || !tournament.accept_applications || !mayHandleApplications(user, tournament)) { return null; @@ -22,7 +24,7 @@ const ApplicationsButton = ({ tournament, user }) => { return <>