diff --git a/src/client/src/TournamentManager.js b/src/client/src/TournamentManager.js index 87db5eb..1f64abb 100644 --- a/src/client/src/TournamentManager.js +++ b/src/client/src/TournamentManager.js @@ -11,6 +11,7 @@ import DeleteIcon from '@mui/icons-material/Delete'; import DateTimePicker from '@mui/lab/DateTimePicker'; import AdapterDateFns from '@mui/lab/AdapterDateFns'; import LocalizationProvider from '@mui/lab/LocalizationProvider'; +import PropTypes from 'prop-types' let submitChanges = curryTournamentId => event => { event.preventDefault(); @@ -77,6 +78,7 @@ let submitChanges = curryTournamentId => event => { .catch((error) => showError(error)); } let deleteTournament = tournamentId => event => { + console.log(tournamentId); event.preventDefault(); //TODO: https://mui.com/components/dialogs/ @@ -172,13 +174,59 @@ function showError(error) { console.error(error); } +function ConfirmationDialogRaw(props) { + const { tournamentId } = useParams(); + const { onClose, value: valueProp, open, ...other } = props; + const [value, setValue] = React.useState(valueProp); + const radioGroupRef = React.useRef(null); + + React.useEffect(() => { + if (!open) { + setValue(valueProp); + } + }, [valueProp, open]); + + const handleCancel = () => { + onClose(); + }; + + return ( + + Yes or No + + Test + + + + + + + ); +} + +ConfirmationDialogRaw.propTypes = { + onClose: PropTypes.func.isRequired, + open: PropTypes.bool.isRequired, + value: PropTypes.string.isRequired, +}; + export default function TournamentManager(props) { const { tournamentId } = useParams(); const [open, setOpen] = React.useState(false); - const handleConfirm = () => { - return true; + const [value, setValue] = React.useState(""); + + const handleClickListItem = () => { + setOpen(true); }; + const handleClose = () => { setOpen(false); }; @@ -191,13 +239,20 @@ export default function TournamentManager(props) { {/* */} - + - - + */} );