From 5394e7fc3caee4ee0a5a02b8f40c7082de9b91c9 Mon Sep 17 00:00:00 2001 From: brausjonas Date: Thu, 4 May 2023 11:55:28 +0200 Subject: [PATCH] Modal (Popup) Component A Component that contains a button to open a modal. Containing A message and a button to abort and send --- anwendung/src/components/Button.jsx | 9 +++-- anwendung/src/components/PopUp.jsx | 39 +++++++++++++++++++ anwendung/src/pages/index.js | 26 +++---------- anwendung/src/styles/globals.css | 58 ++++++++++++++++++++++++++--- 4 files changed, 102 insertions(+), 30 deletions(-) create mode 100644 anwendung/src/components/PopUp.jsx diff --git a/anwendung/src/components/Button.jsx b/anwendung/src/components/Button.jsx index 17fb59c..769e53d 100644 --- a/anwendung/src/components/Button.jsx +++ b/anwendung/src/components/Button.jsx @@ -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 ( <> -