mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2025-12-15 04:13:36 +01:00
Move alert to portal
This commit is contained in:
@@ -12,8 +12,10 @@ import { useAlert, AlertContextProvider } from "../AlertContext";
|
||||
|
||||
function AlertTest() {
|
||||
const [setAlert, dismissAlert] = useAlert();
|
||||
// alert-container serves as an output for Portal which renders Alert
|
||||
return (
|
||||
<>
|
||||
<div id="alert-container" />
|
||||
<button onClick={() => setAlert("Alert content")}>Set alert</button>
|
||||
<button onClick={dismissAlert}>Dismiss alert</button>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user