]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/tournament/SettingsDialog.js
open tournament type
[alttp.git] / resources / js / components / tournament / SettingsDialog.js
index af4d664efe0d2f60c435e169c9a000a395b39bd6..362cd6fbab36595da9754e1784eb4325911984d9 100644 (file)
@@ -9,6 +9,7 @@ import DiscordForm from './DiscordForm';
 import DiscordSelect from '../common/DiscordSelect';
 import Icon from '../common/Icon';
 import ToggleSwitch from '../common/ToggleSwitch';
+import Tournament from '../../helpers/Tournament';
 import i18n from '../../i18n';
 
 const open = async tournament => {
@@ -77,14 +78,16 @@ const SettingsDialog = ({
        <Modal.Body>
                <Row>
                        <Col sm={tournament.discord ? 6 : 12}>
-                               <div className="d-flex align-items-center justify-content-between mb-3">
-                                       <span>{i18n.t('tournaments.open')}</span>
-                                       <ToggleSwitch
-                                               onChange={({ target: { value } }) => value
-                                                       ? open(tournament) : close(tournament)}
-                                               value={tournament.accept_applications}
-                                       />
-                               </div>
+                               {Tournament.hasSignup(tournament) ?
+                                       <div className="d-flex align-items-center justify-content-between mb-3">
+                                               <span>{i18n.t('tournaments.open')}</span>
+                                               <ToggleSwitch
+                                                       onChange={({ target: { value } }) => value
+                                                               ? open(tournament) : close(tournament)}
+                                                       value={tournament.accept_applications}
+                                               />
+                                       </div>
+                               : null}
                                <div className="d-flex align-items-center justify-content-between mb-3">
                                        <span>{i18n.t('tournaments.locked')}</span>
                                        <ToggleSwitch