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 ( +