Import/Export Prototype

This commit is contained in:
Marcel Pöppe
2024-09-23 19:59:46 +02:00
parent 9141d9e6fb
commit 312e4ae1f5
4 changed files with 85 additions and 9 deletions
+36 -3
View File
@@ -1,4 +1,5 @@
import { MouseEventHandler } from "react";
import Popup from "reactjs-popup";
export function Box({title, placeholder, id}:
{title:string; placeholder:string; id:string}) {
@@ -12,7 +13,7 @@ export function Box({title, placeholder, id}:
className="body_box"
id={id}
wrap="soft"
required
rows={6}
placeholder={placeholder}
></textarea>
</div>
@@ -21,13 +22,12 @@ export function Box({title, placeholder, id}:
}
export function Button({title, className, onClickFunc}:
{title:string; className:string; onClickFunc: MouseEventHandler}) {
{title:string; className:string|undefined; onClickFunc: MouseEventHandler}) {
return(
<button
className={className}
onClick={onClickFunc}
type="submit"
>
{title}
</button>
@@ -35,6 +35,39 @@ export function Button({title, className, onClickFunc}:
);
}
export function Popup_Button({title, className}:
{title:string; className:string|undefined;}) {
return(
<Popup
trigger={<button
className={className}>
{title}
</button>}
position="right center"
modal
nested>
{close => (
<div className="popup_bg">
<button onClick={close}>
&times;
</button>
<div className="header"> {title} </div>
<div className="content">
This is a popup example.
</div>
<div className="actions">
<button className="button" onClick={close}>
Cancel</button>
</div>
</div>
)}
</Popup>
);
}
export function Output({id, text}:
{id:string; text:string}) {