Merge branch 'main' of https://github.com/DHBWLoerrach/TIF22A_AnwProjekt_B
This commit is contained in:
@@ -17,6 +17,8 @@ export default function Button(p) {
|
||||
let iconHTML = p.icon;
|
||||
let iconWidth = p.iconWidth, iconHeight = p.iconHeight;
|
||||
let onClick = p.onClick;
|
||||
let color = p.color;
|
||||
let fontColor = p.fontColor;
|
||||
|
||||
//if parameters are not set, they are set to default values
|
||||
if (height == null) height = 50;
|
||||
@@ -24,6 +26,8 @@ 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";
|
||||
if (fontColor == null) fontColor = "white";
|
||||
|
||||
//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 +42,13 @@ 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,
|
||||
color: fontColor
|
||||
}}
|
||||
onClick={onClick}>
|
||||
{text}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
import Button from "@/components/Button";
|
||||
import {useState} from "react";
|
||||
|
||||
let shown = false;
|
||||
|
||||
export default function PopUp() {
|
||||
const [displayState, setDisplayState] = useState("none");
|
||||
|
||||
function toggleModal() {
|
||||
shown = !shown;
|
||||
if (shown)
|
||||
{
|
||||
setDisplayState("block");
|
||||
}
|
||||
else
|
||||
{
|
||||
setDisplayState("none");
|
||||
}
|
||||
console.log("test");
|
||||
}
|
||||
|
||||
function on_abgeben_pressed()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button text={"Abgeben"} onClick={toggleModal}/>
|
||||
|
||||
<div style={{
|
||||
display: displayState
|
||||
}}>
|
||||
|
||||
<div className={"modal-container"}>
|
||||
<div className={"modal"}>
|
||||
<p className={"font-middle"}>Kalender wirklich abgeben?</p>
|
||||
<div>
|
||||
<Button text={"Abbrechen"} color={"#363636"} onClick={toggleModal}/>
|
||||
<Button text={"Abgeben"} color={"#7a7a7a"} onClick={on_abgeben_pressed}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user