From d85a29c15d564bf5915eba6a4188e7168167ffc2 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Fri, 20 Sep 2024 13:59:31 -0400 Subject: [PATCH] fix contact form Signed-off-by: Xe Iaso --- actions/contact.ts | 10 +++ app/about/page.jsx | 122 ---------------------------- app/about/page.tsx | 155 ++++++++++++++++++++++++++++++++++++ app/blog/[...slug]/page.tsx | 4 +- app/contact/page.jsx | 91 +++++++++++---------- content-collections.ts | 1 + data/authors/mimi.md | 1 + 7 files changed, 220 insertions(+), 164 deletions(-) create mode 100644 actions/contact.ts delete mode 100644 app/about/page.jsx create mode 100644 app/about/page.tsx diff --git a/actions/contact.ts b/actions/contact.ts new file mode 100644 index 0000000..68f3c50 --- /dev/null +++ b/actions/contact.ts @@ -0,0 +1,10 @@ +"use server"; + +export default async function contactForm(formData: FormData) { + const rawFormData = { + name: formData.get('name'), + email: formData.get('email'), + message: formData.get('message'), + }; + console.log(rawFormData); +}; \ No newline at end of file diff --git a/app/about/page.jsx b/app/about/page.jsx deleted file mode 100644 index e380ede..0000000 --- a/app/about/page.jsx +++ /dev/null @@ -1,122 +0,0 @@ -import React from 'react'; -import { User, Award, Globe } from 'lucide-react'; -import { Button } from '@/components/ui/Button'; -import { allAuthors } from '@/.content-collections/generated'; -import Image from 'next/image'; - -const TeamMember = ({ name, role, image }) => ( -
- {name} -
-

{name}

-

{role}

-
-
-); - -function shuffle(array) { - let currentIndex = array.length; - - // While there remain elements to shuffle... - while (currentIndex != 0) { - - // Pick a remaining element... - let randomIndex = Math.floor(Math.random() * currentIndex); - currentIndex--; - - // And swap it with the current element. - [array[currentIndex], array[randomIndex]] = [ - array[randomIndex], array[currentIndex]]; - } -} - -const AboutPage = () => { - const teamMembers = allAuthors.map(author => ({ - name: author.displayName, - role: author.role, - image: author.avatarUrl, - })); - shuffle(teamMembers); - - return ( -
-
-
-

About Us

-
-
-
-
-
-
-

- Empowering Canadian Businesses with Innovative Technology -

-

- Techaro Computing Canada is at the forefront of digital transformation, helping businesses across the country leverage cutting-edge technology to drive growth and innovation. -

-
- -
-
-

Our Mission

-
-
-
-
-
- - Client Focus -
-
- We are dedicated to understanding and meeting the unique needs of each client, ensuring their success in the digital landscape. -
-
-
-
- - Innovation -
-
- We continuously explore and implement the latest technologies to provide cutting-edge solutions for our clients. -
-
-
-
- - Canadian Focus -
-
- We are committed to strengthening the Canadian tech ecosystem and helping local businesses compete on a global scale. -
-
-
-
-
- -
-

Our Team

-
- {teamMembers.map((member, index) => ( - - ))} -
-
- -
-
-

Ready to Transform Your Business?

-

Let{"'"}s discuss how Techaro Computing Canada can help you achieve your technology goals.

- -
-
-
-
-
-
- ); -}; - -export default AboutPage; \ No newline at end of file diff --git a/app/about/page.tsx b/app/about/page.tsx new file mode 100644 index 0000000..fd0fa9b --- /dev/null +++ b/app/about/page.tsx @@ -0,0 +1,155 @@ +import React from "react"; +import { User, Award, Globe } from "lucide-react"; +import { Button } from "@/components/ui/Button"; +import { allAuthors } from "@/.content-collections/generated"; +import Image from "next/image"; +import Link from "next/link"; + +const TeamMember = ({ + name, + role, + image, +}: { + name: string; + role: string; + image: string; +}) => ( +
+ {name} +
+

{name}

+

{role}

+
+
+); + +function shuffle(array: any[]) { + let currentIndex = array.length; + + // While there remain elements to shuffle... + while (currentIndex != 0) { + // Pick a remaining element... + let randomIndex = Math.floor(Math.random() * currentIndex); + currentIndex--; + + // And swap it with the current element. + [array[currentIndex], array[randomIndex]] = [ + array[randomIndex], + array[currentIndex], + ]; + } +} + +const AboutPage = () => { + const teamMembers = allAuthors.map((author) => ({ + name: author.displayName, + role: author.role, + image: author.avatarUrl, + })); + shuffle(teamMembers); + + return ( +
+
+
+

About Us

+
+
+
+
+
+
+

+ Empowering Canadian Businesses with Innovative Technology +

+

+ Techaro Computing Canada is at the forefront of digital + transformation, helping businesses across the country leverage + cutting-edge technology to drive growth and innovation. +

+
+ +
+
+

+ Our Mission +

+
+
+
+
+
+ + Client Focus +
+
+ We are dedicated to understanding and meeting the unique + needs of each client, ensuring their success in the + digital landscape. +
+
+
+
+ + Innovation +
+
+ We continuously explore and implement the latest + technologies to provide cutting-edge solutions for our + clients. +
+
+
+
+ + Canadian Focus +
+
+ We are committed to strengthening the Canadian tech + ecosystem and helping local businesses compete on a global + scale. +
+
+
+
+
+ +
+

Our Team

+
+ {teamMembers.map((member, index) => ( + + ))} +
+
+ +
+
+

+ Ready to Transform Your Business? +

+

+ Let{"'"}s discuss how Techaro Computing Canada can help you + achieve your technology goals. +

+ + + +
+
+
+
+
+
+ ); +}; + +export default AboutPage; diff --git a/app/blog/[...slug]/page.tsx b/app/blog/[...slug]/page.tsx index ef8fb57..47345cd 100644 --- a/app/blog/[...slug]/page.tsx +++ b/app/blog/[...slug]/page.tsx @@ -36,10 +36,10 @@ export default async function Page({ params }: { params: PageParams }) { -

+

{page.summary} -

+
{page.image !== undefined && ( { - async function contactForm(formData) { - "use server"; - const rawFormData = { - name: formData.get('name'), - email: formData.get('email'), - message: formData.get('message'), - }; - console.log(rawFormData); - }; + const [message, setMessage] = useState(null); + + const callback = async (formData) => { + await contactForm(formData); + setMessage("Our intrepid team of code monkeys will be looking at this as soon as possible!"); + } return ( -
-

Contact Techaro Computing Canada

- -
-
-

Get in Touch

-

We would love to hear from you. Please fill out the form below or use our contact information.

- -

Contact Information

-

Email: sales@techaro.lol

-

Phone: (123) 456-7890

-

Address: 123 Tech Street, Toronto, ON M5V 1J2

+ <> +
+
+

Contact Us

+
+
+
+
+

Get in Touch

+

We would love to hear from you. Please fill out the form below or use our contact information.

-
-

Contact Form

-
-
- - -
-
- - -
-
- - -
- -
+

Contact Information

+

Email: sales@techaro.lol

+
+ +
+

Contact Form

+
+
+ + +
+
+ + +
+
+ + +
+ + {message !== null && ( + <> +
+

Thanks!

+

{message}

+
+ + )} +
+
-
+ ); }; diff --git a/content-collections.ts b/content-collections.ts index 4d18ab5..8696740 100644 --- a/content-collections.ts +++ b/content-collections.ts @@ -8,6 +8,7 @@ const authors = defineCollection({ schema: (z) => ({ name: z.string(), displayName: z.string(), + active: z.boolean().default(true), role: z.string(), avatarUrl: z.string(), bluesky: z.string().optional(), diff --git a/data/authors/mimi.md b/data/authors/mimi.md index f3f998d..9e843db 100644 --- a/data/authors/mimi.md +++ b/data/authors/mimi.md @@ -4,4 +4,5 @@ displayName: "Mimi Yasomi" role: "Member of Technical Staff" avatarUrl: /img/avatars/mimi.webp bluesky: yasomi.xeiaso.net +active: true ---