From 3c2edea9e06e7e5c4376a08a37723bf599b53335 Mon Sep 17 00:00:00 2001 From: Beau Findlay Date: Wed, 24 Apr 2024 21:55:51 +0100 Subject: [PATCH] Add contact form --- src/Client/src/components/Button.tsx | 19 +++++++ src/Client/src/components/ContactForm.tsx | 58 +++++++++++++++++++++ src/Client/src/components/Label.tsx | 12 +++++ src/Client/src/components/TextAreaInput.tsx | 14 +++++ src/Client/src/components/TextInput.tsx | 14 +++++ src/Client/src/components/Title.tsx | 2 +- src/Client/src/pages/ContactPage.tsx | 4 +- 7 files changed, 121 insertions(+), 2 deletions(-) create mode 100644 src/Client/src/components/Button.tsx create mode 100644 src/Client/src/components/ContactForm.tsx create mode 100644 src/Client/src/components/Label.tsx create mode 100644 src/Client/src/components/TextAreaInput.tsx create mode 100644 src/Client/src/components/TextInput.tsx diff --git a/src/Client/src/components/Button.tsx b/src/Client/src/components/Button.tsx new file mode 100644 index 0000000..d0cfe57 --- /dev/null +++ b/src/Client/src/components/Button.tsx @@ -0,0 +1,19 @@ +import { ReactNode } from "react"; + +interface Props { + type: "submit" | "button"; + children: ReactNode; + onClick?: () => void; +} + +export default function Button({ type, children, onClick }: Props) { + return ( + + ); +} diff --git a/src/Client/src/components/ContactForm.tsx b/src/Client/src/components/ContactForm.tsx new file mode 100644 index 0000000..6b3573c --- /dev/null +++ b/src/Client/src/components/ContactForm.tsx @@ -0,0 +1,58 @@ +import { FaRegPaperPlane } from "react-icons/fa6"; +import Link from "./Link"; +import TextInput from "./TextInput"; +import TextAreaInput from "./TextAreaInput"; +import Button from "./Button"; +import Label from "./Label"; + +export default function ContactForm() { + return ( +
+
{ + event.preventDefault(); + console.log("Submitted"); + }} + > +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + This site is protected by reCAPTCHA and the Google{" "} + + Privacy Policy + {" "} + and{" "} + + Terms of Service + {" "} + apply. + +
+
+ +
+
+
+ ); +} diff --git a/src/Client/src/components/Label.tsx b/src/Client/src/components/Label.tsx new file mode 100644 index 0000000..c35395e --- /dev/null +++ b/src/Client/src/components/Label.tsx @@ -0,0 +1,12 @@ +interface Props { + htmlFor: string; + children: string; +} + +export default function Label({ htmlFor, children }: Props) { + return ( + + ); +} diff --git a/src/Client/src/components/TextAreaInput.tsx b/src/Client/src/components/TextAreaInput.tsx new file mode 100644 index 0000000..6c1790f --- /dev/null +++ b/src/Client/src/components/TextAreaInput.tsx @@ -0,0 +1,14 @@ +interface Props { + id: string; + rows?: number; +} + +export default function TextAreaInput({ id, rows = 4 }: Props) { + return ( + + ); +} diff --git a/src/Client/src/components/TextInput.tsx b/src/Client/src/components/TextInput.tsx new file mode 100644 index 0000000..74e2d09 --- /dev/null +++ b/src/Client/src/components/TextInput.tsx @@ -0,0 +1,14 @@ +interface Props { + id: string; + type: "text" | "email"; +} + +export default function TextInput({ id, type }: Props) { + return ( + + ); +} diff --git a/src/Client/src/components/Title.tsx b/src/Client/src/components/Title.tsx index f46b30d..ba25493 100644 --- a/src/Client/src/components/Title.tsx +++ b/src/Client/src/components/Title.tsx @@ -4,7 +4,7 @@ interface Props { } export default function Title({ children, className }: Props) { - const defaultStyles = "text-4xl"; + const defaultStyles = "text-4xl py-4"; const styles = className ? `${defaultStyles} ${className}` : defaultStyles; return

{children}

; diff --git a/src/Client/src/pages/ContactPage.tsx b/src/Client/src/pages/ContactPage.tsx index 1d17e85..57047d5 100644 --- a/src/Client/src/pages/ContactPage.tsx +++ b/src/Client/src/pages/ContactPage.tsx @@ -1,3 +1,4 @@ +import ContactForm from "../components/ContactForm"; import Text from "../components/Text"; import Title from "../components/Title"; @@ -5,10 +6,11 @@ export default function ContactPage() { return ( <> Contact - + If you think I can help with your project or you'd just like to talk tech, send me a message! + ); }