Install this package:
npm add my_simple_react_modale_tbImport the Modale component:
import { Modale } from "my_simple_react_modale_tb";You can then render the Modale component like any other React component in JSX.
import { Modale } from "my_simple_react_modale_tb";
import { useState } from "react";
const App = () => {
const [showModale, setShowModale] = useState(false);
const handleCLose = () => {
setShowModale(false);
}
return (
<div>
<button onClick={() => setShowModale(true)}>Open Modal</button>
{showModale ?? (
<Modale
onClose={handleClose}
imageSrc={closeBtn}
imageName="close button"
text="Say something"
linkText="Go to somewhere"
linkPath="/"
/>
)}
</div>
);
};