From afc83cce5dd684ae196d364ff58c8674b904ded5 Mon Sep 17 00:00:00 2001 From: THIS ONE IS A LITTLE BIT TRICKY KRUB Date: Wed, 16 Oct 2024 19:59:29 +0700 Subject: [PATCH] chore: Add @types/next package to package.json --- package-lock.json | 198 +++++++++++++++++++ package.json | 1 + src/types/schemas/BusinessForm.tsx | 302 +++++++++++++++++++++++++++++ 3 files changed, 501 insertions(+) create mode 100644 src/types/schemas/BusinessForm.tsx diff --git a/package-lock.json b/package-lock.json index 179a762..808ce5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,6 +51,7 @@ "@playwright/test": "^1.47.2", "@tailwindcss/typography": "^0.5.15", "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/next": "^8.0.7", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", @@ -2193,6 +2194,32 @@ "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" }, + "node_modules/@types/next": { + "version": "8.0.7", + "resolved": "https://registry.npmjs.org/@types/next/-/next-8.0.7.tgz", + "integrity": "sha512-I/Gcj1YfOFmpBBX5XgBP1t1wKcFS0TGk8ytW99ujjvCp8U31QuKqM3fvvGb7+Hf1CJt3BAAgzGT0aCigqO5opQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/next-server": "*", + "@types/node": "*", + "@types/node-fetch": "*", + "@types/react": "*" + } + }, + "node_modules/@types/next-server": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@types/next-server/-/next-server-8.1.2.tgz", + "integrity": "sha512-Fm4QhAxwDlC9AHiGy23Lhv7DeTTt1O1s7tnAsyVOLPjePmYXPZVbOCrxd2oRHZnIIYWw41JelLbq4hN1B5idlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/next": "*", + "@types/node": "*", + "@types/react": "*", + "@types/react-loadable": "*" + } + }, "node_modules/@types/node": { "version": "20.16.10", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.10.tgz", @@ -2201,6 +2228,17 @@ "undici-types": "~6.19.2" } }, + "node_modules/@types/node-fetch": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "form-data": "^4.0.0" + } + }, "node_modules/@types/phoenix": { "version": "1.6.5", "resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.6.5.tgz", @@ -2229,11 +2267,103 @@ "@types/react": "*" } }, + "node_modules/@types/react-loadable": { + "version": "5.5.11", + "resolved": "https://registry.npmjs.org/@types/react-loadable/-/react-loadable-5.5.11.tgz", + "integrity": "sha512-/tq2IJ853MoIFRBmqVOxnGsRRjER5TmEKzsZtaAkiXAWoDeKgR/QNOT1vd9k0p9h/F616X21cpNh3hu4RutzRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "*", + "@types/webpack": "^4" + } + }, + "node_modules/@types/source-list-map": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@types/source-list-map/-/source-list-map-0.1.6.tgz", + "integrity": "sha512-5JcVt1u5HDmlXkwOD2nslZVllBBc7HDuOICfiZah2Z0is8M8g+ddAEawbmd3VjedfDHBzxCaXLs07QEmb7y54g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/tapable": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@types/tapable/-/tapable-1.0.12.tgz", + "integrity": "sha512-bTHG8fcxEqv1M9+TD14P8ok8hjxoOCkfKc8XXLaaD05kI7ohpeI956jtDOD3XHKBQrlyPughUtzm1jtVhHpA5Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/uglify-js": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.17.5.tgz", + "integrity": "sha512-TU+fZFBTBcXj/GpDpDaBmgWk/gn96kMZ+uocaFUlV2f8a6WdMzzI44QBCmGcCiYR0Y6ZlNRiyUyKKt5nl/lbzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "source-map": "^0.6.1" + } + }, + "node_modules/@types/uglify-js/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@types/unist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==" }, + "node_modules/@types/webpack": { + "version": "4.41.39", + "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.39.tgz", + "integrity": "sha512-otxUJvoi6FbBq/64gGH34eblpKLgdi+gf08GaAh8Bx6So0ZZic028Ev/SUxD22gbthMKCkeeiXEat1kHLDJfYg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/tapable": "^1", + "@types/uglify-js": "*", + "@types/webpack-sources": "*", + "anymatch": "^3.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/@types/webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-4nZOdMwSPHZ4pTEZzSp0AsTM4K7Qmu40UKW4tJDiOVs20UzYF9l+qUe4s0ftfN0pin06n+5cWWDJXH+sbhAiDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/source-list-map": "*", + "source-map": "^0.7.3" + } + }, + "node_modules/@types/webpack-sources/node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@types/webpack/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@types/ws": { "version": "8.5.12", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz", @@ -2658,6 +2788,13 @@ "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==", "dev": true }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "license": "MIT" + }, "node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", @@ -2982,6 +3119,19 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/comma-separated-tokens": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", @@ -3346,6 +3496,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", @@ -4280,6 +4440,21 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/form-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/formdata-polyfill": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", @@ -6062,6 +6237,29 @@ "node": ">=8.6" } }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", diff --git a/package.json b/package.json index efe2d9a..f06f633 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "@playwright/test": "^1.47.2", "@tailwindcss/typography": "^0.5.15", "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/next": "^8.0.7", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", diff --git a/src/types/schemas/BusinessForm.tsx b/src/types/schemas/BusinessForm.tsx new file mode 100644 index 0000000..b61c3ad --- /dev/null +++ b/src/types/schemas/BusinessForm.tsx @@ -0,0 +1,302 @@ +import { useState } from "react"; +import { SubmitHandler, useForm } from "react-hook-form"; +import { Button } from "@/components/ui/button"; +import { Label } from "@/components/ui/label"; +import { Switch } from "@/components/ui/switch"; +import { DualOptionSelector } from "@/components/dualSelector"; +import { MultipleOptionSelector } from "@/components/multipleSelector"; +import { Tooltip, TooltipProvider, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip"; +import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; +import { format } from "path"; +import { businessFormSchema } from "@/types/schemas/application.schema"; +import { z } from "zod"; +import { zodResolver } from "@hookform/resolvers/zod"; + +type businessSchema = z.infer; + +const BusinessForm = ({ onSubmit }: { onSubmit: SubmitHandler }) => { + const communitySize = ["N/A", "0-5K", "5-10K", "10-20K", "20-50K", "50-100K", "100K+"]; + + const form = useForm>({ + resolver: zodResolver(businessFormSchema), + defaultValues: {}, + }); + + const handleBusinessFieldChange = (fieldName: string, value: any) => { + switch (fieldName) { + case "isInUS": + setIsInUS(value); + break; + case "isForSale": + setIsForSale(value); + break; + case "isGenerating": + setIsGenerating(value); + break; + } + setValueBusiness(fieldName, value); + }; + + return ( +
+ +
+

About your company

+

+ **All requested information in this section is required. +

+ + {/* Company Name */} + ( + + Company name + + + + + This should be the name your company uses on your website and in the market. + + + + )} + /> + + {/* Industry */} + ( + + Industry + + Industry} + fieldName="industry" + choices={industry} + handleFunction={handleBusinessFieldChange} + description={<>Choose the industry that best aligns with your business.} + placeholder="Select an industry" + selectLabel="Industry" + {...field} + /> + + + + )} + /> + + {/* Raised Money */} + ( + + 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. + + + + )} + /> + + {/* Incorporated in US */} + ( + + Is your company incorporated in the United States? + + Is your company incorporated in the United States?} + name="isInUS" + choice1="Yes" + choice2="No" + handleFunction={handleBusinessFieldChange} + description={ + <>Only companies that are incorporated or formed in the US are eligible to raise via Reg CF. + } + value={isInUS} + {...field} + /> + + + + )} + /> + + {/* Product for Sale */} + ( + + Is your product available (for sale) in market? + + Is your product available (for sale) in market?} + name="isForSale" + choice1="Yes" + choice2="No" + handleFunction={handleBusinessFieldChange} + description={<>Only check this box if customers can access, use, or buy your product today.} + value={isForSale} + {...field} + /> + + + + )} + /> + + {/* Generating Revenue */} + ( + + Is your company generating revenue? + + Is your company generating revenue?} + name="isGenerating" + choice1="Yes" + choice2="No" + handleFunction={handleBusinessFieldChange} + description={ + <>Only check this box if your company is making money. Please elaborate on revenue below. + } + value={isGenerating} + {...field} + /> + + + + )} + /> + + {/* Pitch Deck */} + ( + + Pitch deck + +
+ + +
+ + {businessPitchFile && ( +
+ 1. {businessPitchFile} + +
+ )} +
+ +
+ )} + /> + + {/* Community Size */} + ( + + What's the rough size of your community? + + What's the rough size of your community?} + fieldName="communitySize" + choices={communitySize} + handleFunction={handleBusinessFieldChange} + description={ + <>Include your email list, social media following (e.g., Instagram, Discord, Twitter). + } + placeholder="Select" + selectLabel="Select" + {...field} + /> + + + + )} + /> + + {/* Apply for First Fundraising Project */} + ( + + +
+ setApplyProject(!applyProject)} {...field} /> + + + + + Would you like to apply for your first fundraising project as well? + + + +

+ Toggling this option allows you to begin your first project, which is crucial for unlocking + fundraising tools. +

+
+
+
+
+
+ +
+ )} + /> + + {/* Submit Button */} + +
+
+ + ); +}; + +export default BusinessForm;