From dfefe603cfbd47e20838f76437e181b37268437e Mon Sep 17 00:00:00 2001 From: THIS ONE IS A LITTLE BIT TRICKY KRUB Date: Wed, 9 Oct 2024 16:19:13 +0700 Subject: [PATCH] Update package.json and package-lock.json --- package-lock.json | 17 + package.json | 1 + src/app/business/apply/page.tsx | 672 +++++++++++++++++--------------- 3 files changed, 369 insertions(+), 321 deletions(-) diff --git a/package-lock.json b/package-lock.json index 00c256c..9c88ef2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,6 +38,7 @@ "react": "^18", "react-countup": "^6.5.3", "react-dom": "^18", + "react-hook-form": "^7.53.0", "react-hot-toast": "^2.4.1", "react-markdown": "^9.0.1", "recharts": "^2.12.7", @@ -6465,6 +6466,22 @@ "react": "^18.3.1" } }, + "node_modules/react-hook-form": { + "version": "7.53.0", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.53.0.tgz", + "integrity": "sha512-M1n3HhqCww6S2hxLxciEXy2oISPnAzxY7gvwVPrtlczTM/1dDadXgUxDpHMrMTblDOcm/AXtXxHwZ3jpg1mqKQ==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/react-hook-form" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17 || ^18 || ^19" + } + }, "node_modules/react-hot-toast": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/react-hot-toast/-/react-hot-toast-2.4.1.tgz", diff --git a/package.json b/package.json index b372e61..fdfd953 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "react": "^18", "react-countup": "^6.5.3", "react-dom": "^18", + "react-hook-form": "^7.53.0", "react-hot-toast": "^2.4.1", "react-markdown": "^9.0.1", "recharts": "^2.12.7", diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index 5ac5ad8..3d58f3a 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -14,10 +14,13 @@ import { import { createSupabaseClient } from "@/lib/supabase/clientComponentClient"; import { useEffect, useState } from "react"; import { Textarea } from "@/components/ui/textarea"; +import { useForm } from "react-hook-form"; export default function Apply() { let supabase = createSupabaseClient(); + const { register, handleSubmit, setValue } = useForm(); const [industry, setIndustry] = useState([]); + const [selectedIndustry, setSelectedIndustry] = useState(""); const [isInUS, setIsInUS] = useState(""); const [isForSale, setIsForSale] = useState(""); const [isGenerating, setIsGenarting] = useState(""); @@ -34,6 +37,13 @@ export default function Apply() { "100K+", ]; + const onSubmit = (data: any) => { + alert(JSON.stringify(data)); + }; + const handleSelectChange = (value: string) => { + setSelectedIndustry(value); + setValue("industry", value); + }; const fetchIndustry = async () => { let { data: BusinessType, error } = await supabase .from("BusinessType") @@ -83,339 +93,359 @@ export default function Apply() {

-
-

About your company

-

- All requested information in this section is required. -

- {/* form */} - - {/* company name */} -
-
- -
- - - This should be the name your company uses on your
- website and in the market. -
-
-
- {/* industry */} -
- -
- - - Choose the industry that best aligns with your business. - -
-
- {/* How much money has your company raised to date? */} -
- -
- - - The sum total of past financing, including angel or venture{" "} -
- capital, loans, grants, or token sales. -
-
-
- {/* Is your company incorporated in the United States? */} -
- -
-
- - -
- - Only companies that are incorporated or formed in the US are{" "} -
- eligible to raise via Reg CF. If your company is incorporated{" "} -
- outside the US, we still encourage you to apply. -
-
-
- - {/* Is your product available (for sale) in market? */} -
- -
-
- - -
- - Only check this box if customers can access, use, or buy your{" "} -
- product today. -
-
-
- - {/* Is your company generating revenue?*/} -
- -
-
- - -
- - Only check this box if your company is making money.
- Please elaborate on revenue and other traction below. -
-
-
- - {/* Pitch deck */} -
- -
- - -
-
- - - Your pitch deck and other application info will be used for{" "} -
- internal purposes only.
- Please make sure this document is publicly accessible. This can{" "} -
- be a DocSend, Box, Dropbox, Google Drive or other link. -
-
-
- - {/* What's the rough size of your community? */} -
- -
- - - Include your email list, social media following (i.e. Instagram,{" "} -
Discord, Facebook, Twitter, TikTok). We’d like to - understand the
rough size of your current audience. -
-
-
-
-
- - {/* apply first project */} -
- {/* header */} -
-

- Begin Your First Fundraising Project -

-

- Starting a fundraising project is mandatory for all businesses. This - step is crucial
- to begin your journey and unlock the necessary tools for raising - funds. + {/* form */} +

+
+

About your company

+

+ All requested information in this section is required.

- {/* project's name */} -
- -
- + {/* company name */} +
+
+ +
+ + + This should be the name your company uses on your
+ website and in the market. +
+
+
+ {/* industry */} +
+ +
+ + + {/* {selectedIndustry} */} + + Choose the industry that best aligns with your business. + +
+
+ {/* How much money has your company raised to date? */} +
+ +
+ + + The sum total of past financing, including angel or venture{" "} +
+ capital, loans, grants, or token sales. +
+
+
+ {/* Is your company incorporated in the United States? */} +
+ +
+
+ + +
+ + Only companies that are incorporated or formed in the US are{" "} +
+ eligible to raise via Reg CF. If your company is incorporated{" "} +
+ outside the US, we still encourage you to apply. +
+
-
- {/* project type */} -
- -
- - - Please specify the primary purpose of the funds - + {/* Is your product available (for sale) in market? */} +
+ +
+
+ + +
+ + Only check this box if customers can access, use, or buy your{" "} +
+ product today. +
+
-
- {/* short description */} -
- -
-