diff --git a/src/components/ContactForm.css b/src/components/ContactForm.css new file mode 100644 index 0000000..728e307 --- /dev/null +++ b/src/components/ContactForm.css @@ -0,0 +1,90 @@ +/* Style inputs, select elements and textareas */ +input[type=email], select, textarea{ + width: 100%; + padding: 3px; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + resize: vertical; + background-color: #f26e0a; + +} + +input[type=submit] { + background-color: #aa0404; + color: white; + padding: 6px 10px; + border: none; + border-radius: 4px; + cursor: pointer; + width: 50%; + height: 25px; +} + + + /* Style the label to display next to the inputs */ + label + { + padding: 2px 12px 2px 0; + display: inline-block; + } + + .flexCenter + { + display: flex; + flex-direction: row; + justify-content: center; + } + .containerForm + { + display: flex; + flex-direction: row; + border-radius: 5px; + background-color: #f6602e; + padding: 20px; + justify-content: center; + width: 400px; + } + + .formForm + { + display: flex; + flex-direction: column; + max-width: 600px; + } + + + /* Floating column for labels: 25% width */ + .col-25 + { + float: left; + width: 25%; + margin-top: 6px; + } + + /* Floating column for inputs: 75% width */ + .col-75 + { + float: left; + width: 75%; + margin-top: 6px; + } + + .rowForm + { + display: flex; + flex-direction: row; + justify-content: space-between; +} + + .row + { + display: flex; + flex-direction: column; + } + + .textArea + { + height: 100px; + } + \ No newline at end of file diff --git a/src/components/ContactForm2.css b/src/components/ContactForm2.css new file mode 100644 index 0000000..14279ab --- /dev/null +++ b/src/components/ContactForm2.css @@ -0,0 +1,60 @@ +/* Style inputs, select elements and textareas */ + + /* Style the label to display next to the inputs */ + label + { + padding: 12px 12px 12px 0; + display: inline-block; + } + + + .formForm + { + display: flex; + flex-direction: column; + + } + /* Style the container */ + .containerForm + { + display: flex; + flex-direction: row; + border-radius: 5px; + background-color: #f2f2f2; + padding: 20px; + width: 600px; + } + + /* Floating column for labels: 25% width */ + .col-25 + { + float: left; + width: 25%; + margin-top: 6px; + } + + /* Floating column for inputs: 75% width */ + .col-75 + { + float: left; + width: 75%; + margin-top: 6px; + } + + .rowForm + { + display: flex; + flex-direction: column; + } + + .row + { + display: flex; + flex-direction: column; + } + + .textArea + { + height: 200px; + } + \ No newline at end of file diff --git a/src/components/Dog.css b/src/components/Dog.css index cb1c1d1..2006ddc 100644 --- a/src/components/Dog.css +++ b/src/components/Dog.css @@ -5,6 +5,11 @@ margin: 5px; } +.text +{ + margin: 5px; +} + button { max-width: 30%; diff --git a/src/components/DogContactForm.tsx b/src/components/DogContactForm.tsx index 9531494..98de99b 100644 --- a/src/components/DogContactForm.tsx +++ b/src/components/DogContactForm.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import toast, { Toaster } from "react-hot-toast"; import { foundMsg, logFormData } from "../services/PhpApi"; - +import './ContactForm.css'; export default function DogContactForm( {toEmail, name, qr_id}: @@ -20,6 +20,16 @@ export default function DogContactForm( }) + } + + const onChangeInputTextArea = (e: React.FormEvent ) => + { + setFormData({ + ...formData, + [e.currentTarget.name]:e.currentTarget.value + }) + + } const submitForm = async (e: React.FormEvent) => @@ -41,8 +51,6 @@ export default function DogContactForm( { const index = keys.indexOf(key); sendData.append(key, values[index]); - - console.log(key + ' ' + sendData.get(key)); } sendData.append('toEmail', toEmail); @@ -51,11 +59,11 @@ export default function DogContactForm( logFormData(sendData); - const data = await foundMsg(sendData); -// const data = { -// success:0, -// message: 'yyy' -// }; + //const data = await foundMsg(sendData); +const data = { + success:0, + message: 'error' + }; if(data.success) { @@ -68,18 +76,43 @@ export default function DogContactForm( } return ( -
- -
- - + <> +
+
+ + +

Bitte schreib eine Email:

+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+
+ + + \ No newline at end of file