Modal (Popup) Component

A Component that contains a button to open a modal. Containing A message and a button to abort and send
This commit is contained in:
brausjonas
2023-05-04 11:55:28 +02:00
parent cc39ce4e90
commit 5394e7fc3c
4 changed files with 102 additions and 30 deletions
+5 -4
View File
@@ -17,6 +17,7 @@ export default function Button(p) {
let iconHTML = p.icon;
let iconWidth = p.iconWidth, iconHeight = p.iconHeight;
let onClick = p.onClick;
let color = p.color;
//if parameters are not set, they are set to default values
if (height == null) height = 50;
@@ -24,6 +25,7 @@ export default function Button(p) {
if (iconWidth == null) iconWidth = width-10;
if (iconHeight == null) iconHeight = height-10;
if (onClick == null) onClick = () => {};
if (color == null) color = "#363636";
//build in the icon width and height to the svg tag (svg tag should not contain any size information by default)
if (iconHTML != null) {
@@ -38,13 +40,12 @@ export default function Button(p) {
//return the button
return (
<>
<button className={"round-border button font font-middle"}
<button className={"round-border button font font-small"}
style={{
width: width,
height: height,
display: "flex",
alignItems: "center",
justifyContent: "center"
justifyContent: "center",
backgroundColor: color
}}
onClick={onClick}>
{text}