X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Frounds%2FLockDialog.js;fp=resources%2Fjs%2Fcomponents%2Frounds%2FLockDialog.js;h=690e85c71d5c9dfd3c97bf84031541a611616b4c;hb=d1f28ea443b090c7593791eba9631796ccaeafe1;hp=0000000000000000000000000000000000000000;hpb=eebc6384e56336b66ec250fc2aea3be6171d53ff;p=alttp.git diff --git a/resources/js/components/rounds/LockDialog.js b/resources/js/components/rounds/LockDialog.js new file mode 100644 index 0000000..690e85c --- /dev/null +++ b/resources/js/components/rounds/LockDialog.js @@ -0,0 +1,78 @@ +import axios from 'axios'; +import PropTypes from 'prop-types'; +import React from 'react'; +import { Alert, Button, Modal } from 'react-bootstrap'; +import { withTranslation } from 'react-i18next'; +import toastr from 'toastr'; + +import { isComplete } from '../../helpers/Round'; +import i18n from '../../i18n'; + +const LockDialog = ({ + onHide, + round, + show, + tournament, +}) => + + + + {i18n.t(round.locked ? 'rounds.unlock' : 'rounds.lock')} + + + +

{i18n.t(round.locked + ? 'rounds.unlockDescription' + : 'rounds.lockDescription')} +

+ {!round.locked && !isComplete(tournament, round) ? + + {i18n.t('rounds.lockIncompleteWarning')} + + : null} +
+ + {onHide ? + + : null} + + +
; + +LockDialog.propTypes = { + onHide: PropTypes.func, + round: PropTypes.shape({ + id: PropTypes.number, + locked: PropTypes.bool, + }), + show: PropTypes.bool, + tournament: PropTypes.shape({ + }), +}; + +export default withTranslation()(LockDialog);