Added Submitbutton
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
import {baseURL} from "@/components/Constants";
|
||||
import Button from "@/components/Button";
|
||||
|
||||
export default function SubmitWarning(p){
|
||||
|
||||
async function submit() {
|
||||
let url = baseURL + "/module?sessionid=" + localStorage.getItem("sessionid");
|
||||
|
||||
let json1 = {
|
||||
"id": 0,
|
||||
"userid": localStorage.getItem("userid"),
|
||||
"semesterid": localStorage.getItem("currentsid"),
|
||||
"name": localStorage.getItem("currentmodulename"),
|
||||
"activated": 0
|
||||
}
|
||||
|
||||
await fetch(url, {
|
||||
method: "PUT",
|
||||
headers: {"Content-Type": "application/json"},
|
||||
body: JSON.stringify(json1)
|
||||
})
|
||||
|
||||
p.onClick();
|
||||
p.onClick();
|
||||
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="box-shadow" style={{
|
||||
position: "absolute",
|
||||
top: 300,
|
||||
left: 0,
|
||||
right: 0,
|
||||
borderRadius: 5,
|
||||
textAlign: "center",
|
||||
fontSize: 20,
|
||||
margin: "auto",
|
||||
width: 600
|
||||
|
||||
}}>
|
||||
<p style={{paddingTop: 20, paddingBottom: 5}}>Möchten Sie wirklich abgeben?</p>
|
||||
<p>Danach können Sie keine Änderungen mehr vornehmen!</p>
|
||||
<div style={{
|
||||
display: "flex",
|
||||
flexDirection: "row",
|
||||
justifyContent: "center",
|
||||
paddingTop: 40,
|
||||
paddingBottom: 20
|
||||
}}>
|
||||
<Button onClick={() => submit()} text={"Bestätigen"} color={"#77932b"} width={100} height={40} />
|
||||
<div style={{width: 20}}></div>
|
||||
<Button onClick={() => p.onClick()} text={"Abbrechen"} color={"red"} width={100} height={40} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user