diff --git a/src/App.css b/src/App.css index 7d2292f..40d45f0 100644 --- a/src/App.css +++ b/src/App.css @@ -71,3 +71,14 @@ button { background-color: black; border: 4px solid black; } + +::backdrop { + background-image: linear-gradient( + 45deg, + magenta, + rebeccapurple, + dodgerblue, + green + ); + opacity: 0.75; +} diff --git a/src/App.tsx b/src/App.tsx index 528d4cf..f0fd30c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -50,14 +50,19 @@ function App() { const [playersMiddle, setPlayersMiddle] = useState(players); const [playersRight, setPlayersRight] = useState([]); + const [dialog, setDialog] = useState("dialog"); + function handleSubmit() { + const dialog = document.querySelector("dialog"); if (user.length < 1) { - alert("who are you?"); - return; - } - for (const u of user) { - console.log(u.name); + setDialog("who are you?"); + } else { + for (const u of user) { + setDialog("sending..."); + console.log(u.name); + } } + dialog?.showModal(); } return ( @@ -111,13 +116,14 @@ function App() { - + { + event.currentTarget.close(); + }} > - submit - + {dialog} +