]> git.localhorst.tv Git - alttp.git/blob - resources/js/components/tournament/SettingsButton.js
tournament admin control
[alttp.git] / resources / js / components / tournament / SettingsButton.js
1 import PropTypes from 'prop-types';
2 import React, { useState } from 'react';
3 import { Button } from 'react-bootstrap';
4 import { withTranslation } from 'react-i18next';
5
6 import SettingsDialog from './SettingsDialog';
7 import Icon from '../common/Icon';
8 import i18n from '../../i18n';
9
10 const SettingsButton = ({ tournament }) => {
11         const [showDialog, setShowDialog] = useState(false);
12
13         return <>
14                 <Button
15                         onClick={() => setShowDialog(true)}
16                         title={i18n.t('button.settings')}
17                         variant="outline-secondary"
18                 >
19                         <Icon.SETTINGS title="" />
20                 </Button>
21                 <SettingsDialog
22                         onHide={() => setShowDialog(false)}
23                         tournament={tournament}
24                         show={showDialog}
25                 />
26         </>;
27 };
28
29 SettingsButton.propTypes = {
30         tournament: PropTypes.shape({
31         }),
32 };
33
34 export default withTranslation()(SettingsButton);