adjusted css
This commit is contained in:
@@ -26,7 +26,6 @@ export const handler: Handlers = {
|
||||
message: formData.get("message")?.toString(),
|
||||
};
|
||||
|
||||
// Validation logic
|
||||
const errors: FormState["errors"] = {};
|
||||
|
||||
if (!state.name || state.name.trim() === "") {
|
||||
@@ -44,7 +43,6 @@ export const handler: Handlers = {
|
||||
errors.message = "Message is required";
|
||||
}
|
||||
|
||||
// If there are errors, return the form with error messages
|
||||
if (Object.keys(errors).length > 0) {
|
||||
return ctx.render({
|
||||
...state,
|
||||
@@ -56,7 +54,6 @@ export const handler: Handlers = {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
});
|
||||
console.log(res);
|
||||
|
||||
if (!res.ok || res.status !== 200) {
|
||||
return ctx.render({
|
||||
@@ -77,11 +74,15 @@ export default function Contact({ data }: PageProps<FormState>) {
|
||||
<div class="bg-[#313244] min-h-screen">
|
||||
<div class="px-4 py-8 mx-auto p-6 flex flex-col bg-[#313244] min-h-screen w-full md:max-w-md">
|
||||
<Head>
|
||||
<title>Contact</title>
|
||||
<title>Wyatt J. Miller | Contact</title>
|
||||
</Head>
|
||||
<h1 class="text-3xl text-white font-bold uppercase text-center">
|
||||
Contact
|
||||
</h1>
|
||||
<p class="md:text-lg sm:text-md text-white mt-5 mb-5">
|
||||
Got a question? Here to yell at me? Send me something!
|
||||
</p>
|
||||
<br />
|
||||
{data?.submitted && (
|
||||
<div
|
||||
class="bg-[#a6e3a1] text-[#313244] px-4 py-3 rounded relative"
|
||||
@@ -114,7 +115,7 @@ export default function Contact({ data }: PageProps<FormState>) {
|
||||
required
|
||||
placeholder="Your Name"
|
||||
value={data?.name || ""}
|
||||
class={`w-full px-3 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500
|
||||
class={`w-full px-3 py-2 bg-[#ECECEE] border rounded-md focus:outline-transparent
|
||||
${data?.errors?.name ? "border-[#f38ba8]" : "border-[#313244]"}`}
|
||||
/>
|
||||
{data?.errors?.name && (
|
||||
@@ -137,7 +138,7 @@ export default function Contact({ data }: PageProps<FormState>) {
|
||||
required
|
||||
placeholder="your@email.com"
|
||||
value={data?.email || ""}
|
||||
class={`w-full px-3 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500
|
||||
class={`w-full px-3 py-2 bg-[#ECECEE] border rounded-md focus:outline-transparent
|
||||
${data?.errors?.email ? "border-[#f38ba8]" : "border-[#313244]"}`}
|
||||
/>
|
||||
{data?.errors?.email && (
|
||||
@@ -159,7 +160,7 @@ export default function Contact({ data }: PageProps<FormState>) {
|
||||
required
|
||||
placeholder="Write your message here..."
|
||||
rows={4}
|
||||
class={`w-full px-3 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500
|
||||
class={`w-full px-3 py-2 bg-[#ECECEE] border rounded-md focus:outline-transparent
|
||||
${data?.errors?.message ? "border-red-500" : "border-gray-300"}`}
|
||||
>
|
||||
{data?.message || ""}
|
||||
|
Reference in New Issue
Block a user