]> git.localhorst.tv Git - alttp.git/commitdiff
hide comment button for open rounds without result
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 1 Nov 2022 18:06:15 +0000 (19:06 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 1 Nov 2022 18:06:15 +0000 (19:06 +0100)
resources/js/components/results/ReportButton.js

index ec8f8fd17156e920f7acb74bc14171e48f83a1d1..9db944ee79ace429eed3928e6d4b5bcd10440768 100644 (file)
@@ -28,6 +28,10 @@ const getButtonLabel = (user, round) => {
 const ReportButton = ({ round, user }) => {
        const [showDialog, setShowDialog] = useState(false);
 
+       if (round.locked && !findResult(user, round)) {
+               return null;
+       }
+
        return <>
                <Button
                        onClick={() => setShowDialog(true)}
@@ -48,6 +52,7 @@ const ReportButton = ({ round, user }) => {
 
 ReportButton.propTypes = {
        round: PropTypes.shape({
+               locked: PropTypes.bool,
        }),
        tournament: PropTypes.shape({
        }),