diff --git a/next.config.mjs b/next.config.mjs index ed42a98d..83c9eea1 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,7 +1,7 @@ /** @type {import('next').NextConfig} */ const nextConfig = { output: "export", - // images: { unoptimized: true }, + images: { unoptimized: true }, }; export default nextConfig; diff --git a/public/nodeformbg.png b/public/nodeformbg.png new file mode 100644 index 00000000..951e3253 Binary files /dev/null and b/public/nodeformbg.png differ diff --git a/src/app/nodeform/page.jsx b/src/app/nodeform/page.jsx new file mode 100644 index 00000000..19ae3f83 --- /dev/null +++ b/src/app/nodeform/page.jsx @@ -0,0 +1,215 @@ +"use client"; +import React from "react"; +import { useState, useEffect } from "react"; + +const Page = () => { + const [name, setname] = useState(""); + const [email, setemail] = useState(""); + const [telegram, settelegram] = useState(""); + const [projectname, setprojectname] = useState(""); + const [projecturl, setprojecturl] = useState(""); + const [region, setregion] = useState(""); + const [checked, setChecked] = useState(null); + const [twitter, settwitter] = useState(""); + const [wallet, setwallet] = useState(""); + + // Handler functions for checkbox click events + const handleYesChange = () => { + setChecked("yes"); + }; + + const handleNoChange = () => { + setChecked("no"); + }; + + // Handler function for form submission + const handleSubmit = async (e) => { + e.preventDefault(); + + // Gather form data + const formData = { + name, + email, + telegram_id: telegram, + project_name: projectname, + project_id: projecturl, + region, + twitter_id: twitter, + ran_node_before: checked === "yes", + wallet_address: wallet + }; + + try { + // Send POST request to API + const response = await fetch( + "https://dev.gateway.erebrus.io/api/v1.0/operator/new", + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(formData), + } + ); + + if (!response.ok) { + throw new Error("Network response was not ok"); + } + + // Handle successful response + const result = await response.json(); + console.log("Form submitted successfully:", result); + // You can add any success message or redirection here + } catch (error) { + console.error("Error submitting form:", error); + // You can add error handling here + } + }; + + return ( +
+
+
+
+ Fill the required details +
+ +
+
Name
+ setname(e.target.value)} + className="mt-2 shadow border appearance-none rounded-xl w-full py-4 px-6 text-gray-200 leading-tight focus:outline-none focus:shadow-outline" + style={{ color: "black", backgroundColor: "#0B6A604D" }} + /> +
+
+
Email
+ setemail(e.target.value)} + className="mt-2 shadow border appearance-none rounded-xl w-full py-4 px-6 text-gray-200 leading-tight focus:outline-none focus:shadow-outline" + style={{ color: "black", backgroundColor: "#0B6A604D" }} + /> +
+
+
Telegram
+ settelegram(e.target.value)} + className="mt-2 shadow border appearance-none rounded-xl w-full py-4 px-6 text-gray-200 leading-tight focus:outline-none focus:shadow-outline" + style={{ color: "black", backgroundColor: "#0B6A604D" }} + /> +
+
+ +
Have you ran a node before
+ +
+ + + +
+ +
Tell us your project name
+ setprojectname(e.target.value)} + className="mt-2 shadow border appearance-none rounded-xl w-full py-4 px-6 text-gray-200 leading-tight focus:outline-none focus:shadow-outline" + style={{ color: "black", backgroundColor: "#0B6A604D" }} + /> + +
Project URL
+ setprojecturl(e.target.value)} + className="mt-2 shadow border appearance-none rounded-xl w-full py-4 px-6 text-gray-200 leading-tight focus:outline-none focus:shadow-outline" + style={{ color: "black", backgroundColor: "#0B6A604D" }} + /> + +
+
+
Node Region
+ setregion(e.target.value)} + className="mt-2 shadow border appearance-none rounded-xl w-full py-4 px-6 text-gray-200 leading-tight focus:outline-none focus:shadow-outline" + style={{ color: "black", backgroundColor: "#0B6A604D" }} + /> +
+
+
Twitter ID
+ settwitter(e.target.value)} + className="mt-2 shadow border appearance-none rounded-xl w-full py-4 px-6 text-gray-200 leading-tight focus:outline-none focus:shadow-outline" + style={{ color: "black", backgroundColor: "#0B6A604D" }} + /> +
+
+ +
Wallet Address
+ setwallet(e.target.value)} + className="mt-2 shadow border appearance-none rounded-xl w-full py-4 px-6 text-gray-200 leading-tight focus:outline-none focus:shadow-outline" + style={{ color: "black", backgroundColor: "#0B6A604D" }} + /> + + +
+
+
+
+ ); +}; + +export default Page; diff --git a/src/components/DarkBtn.jsx b/src/components/DarkBtn.jsx index b65bbc81..a0a927fc 100644 --- a/src/components/DarkBtn.jsx +++ b/src/components/DarkBtn.jsx @@ -4,7 +4,7 @@ import React from "react"; const DarkBtn = ({ title, width = "w-[80px] lg:w-[170px]", link = "/" }) => { return (