|
|
|
@ -1,16 +1,22 @@
|
|
|
|
|
|
|
|
import { useState } from "react";
|
|
|
|
|
|
|
|
import Alert from "./components/Alert";
|
|
|
|
import { Button } from "./components/Button";
|
|
|
|
import { Button } from "./components/Button";
|
|
|
|
|
|
|
|
|
|
|
|
function handleOnClick() {
|
|
|
|
|
|
|
|
console.log("Clicked");
|
|
|
|
// function handleOnClick() {
|
|
|
|
}
|
|
|
|
// //console.log("Clicked");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
function App() {
|
|
|
|
function App() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [alertVisible, setAlertVisibility] = useState(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<Button onClick={handleOnClick} color="success">My Button</Button>
|
|
|
|
{alertVisible && <Alert onClose={()=>setAlertVisibility(false)}>Holly wacamole!</Alert>}
|
|
|
|
|
|
|
|
<Button onClick={()=>setAlertVisibility(true)} color="success">My Button</Button>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|