Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions components/contact-form.js → app/components/contact-form.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import * as React from "react";

"use client"
import { useForm, ValidationError } from "@formspree/react";
import formStyles from "../styles/form.module.css";
import formStyles from "../../styles/form.module.css";

export default function ContactForm() {
const [state, handleSubmit] = useForm(process.env.NEXT_PUBLIC_FORM);
const [state, handleSubmit] = useForm("YOUR_FORM_ID");

if (state.succeeded) {
return <p>Thanks for your submission!</p>;
}

return (
<form onSubmit={handleSubmit} className={formStyles.container}>
<form onSubmit={handleSubmit} className={formStyles.container}>
<label htmlFor="email" className={formStyles.labels}>
Your email:
</label>
Expand Down Expand Up @@ -51,4 +54,4 @@ export default function ContactForm() {
/>
</form>
);
}
}
Binary file added app/favicon.ico
Binary file not shown.
28 changes: 28 additions & 0 deletions app/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Geist, Geist_Mono } from "next/font/google";

const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});

const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});

export const metadata = {
title: "Create Next App",
description: "Generated by create next app",
};

export default function RootLayout({ children }) {
return (
<html lang="en">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
</body>
</html>
);
}
4 changes: 2 additions & 2 deletions pages/index.js → app/page.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Head from "next/head";
import styles from "../styles/Home.module.css";
import ContactForm from "../components/contact-form";
import ContactForm from "./components/contact-form";

export default function Home() {
return (
Expand Down Expand Up @@ -40,4 +40,4 @@ export default function Home() {
</footer>
</div>
);
}
}
14 changes: 14 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
});

const eslintConfig = [...compat.extends("next/core-web-vitals")];

export default eslintConfig;
7 changes: 7 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"paths": {
"@/*": ["./*"]
}
}
}
4 changes: 4 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};

export default nextConfig;
Loading