About your company
@@ -306,7 +329,7 @@ export default function Apply() {
type="text"
id="companyName"
className="w-96"
- {...registerBusiness("companyName")}
+ {...register("companyName")}
/>
This should be the name your company uses on your
@@ -329,7 +352,7 @@ export default function Apply() {
header={<>Industry>}
fieldName="industry"
choices={industry}
- handleFunction={handleFieldChange}
+ handleFunction={handleBusinessFieldChange}
description={
<>Choose the industry that best aligns with your business.>
}
@@ -352,7 +375,7 @@ export default function Apply() {
id="totalRaised"
className="w-96"
placeholder="$ 1,000,000"
- {...registerBusiness("totalRaised", {
+ {...register("totalRaised", {
valueAsNumber: true,
})}
/>
@@ -379,7 +402,7 @@ export default function Apply() {
name="isInUS"
choice1="Yes"
choice2="No"
- handleFunction={handleFieldChange}
+ handleFunction={handleBusinessFieldChange}
description={
<>
Only companies that are incorporated or formed in the US are{" "}
@@ -408,7 +431,7 @@ export default function Apply() {
name="isForSale"
choice1="Yes"
choice2="No"
- handleFunction={handleFieldChange}
+ handleFunction={handleBusinessFieldChange}
description={
<>
Only check this box if customers can access, use, or buy your{" "}
@@ -430,7 +453,7 @@ export default function Apply() {
name="isGenerating"
choice1="Yes"
choice2="No"
- handleFunction={handleFieldChange}
+ handleFunction={handleBusinessFieldChange}
description={
<>
Only check this box if your company is making money.
@@ -478,7 +501,7 @@ export default function Apply() {
: "https:// "
}
accept={businessPitch === "file" ? ".md" : undefined}
- {...registerBusiness("businessPitchDeck", { required: true })}
+ {...register("businessPitchDeck", { required: true })}
/>
@@ -508,7 +531,7 @@ export default function Apply() {
}
fieldName="communitySize"
choices={communitySize}
- handleFunction={handleFieldChange}
+ handleFunction={handleBusinessFieldChange}
description={
<>
{" "}
@@ -555,231 +578,289 @@ export default function Apply() {
{/* apply first project */}
{applyProject && (
- {errorsBusiness.pitchDeck && (
+ {errorsBusiness.businessPitchDeck && (
- {errorsBusiness.pitchDeck.message as string}
+ {errorsBusiness.businessPitchDeck.message as string}
)}
-
{/* project's name */}
@@ -611,7 +664,6 @@ export default function Apply() {
{errorsProject.projectName.message as string}
)}
-
{/* project type */}
Project type>}
@@ -629,7 +681,6 @@ export default function Apply() {
{errorsProject.projectType.message as string}
)}
-
{/* short description */}
@@ -652,7 +703,6 @@ export default function Apply() {
{errorsProject.shortDescription.message as string}
)}
-
{/* Pitch deck */}
@@ -705,7 +755,6 @@ export default function Apply() {
{errorsProject.projectPitchDeck.message as string}
)}
-
{/* project logo */}
{
+ const file = e.target.files?.[0];
+ registerSecondForm("projectLogo").onChange({
+ target: { name: "projectLogo", value: file },
+ });
+ // Set the file value directly in the form
+ registerSecondForm("projectLogo").onChange({
+ target: { name: "projectLogo", value: file },
+ });
+ }}
/>
Please upload the logo picture that best represents your
@@ -733,11 +791,10 @@ export default function Apply() {
{errorsProject.projectLogo.message as string}
)}
-
- {/* Project pictures */}
+ {/* Project Photos
- {errorsProject.projectPhotos && (
+ */}
+ {/* {errorsProject.projectPhotos && (
{errorsProject.projectPhotos.message as string}
- )}
-
+ )} */}
{/* Minimum Investment */}
@@ -810,7 +866,6 @@ export default function Apply() {
{errorsProject.minInvest.message as string}
)}
-
{/* Target Investment */}
@@ -837,7 +892,6 @@ export default function Apply() {
{errorsProject.targetInvest.message as string}
)}
-
{/* Deadline */}
From e58e9549913ab63c6d178366f9d7bdf14ef213f8 Mon Sep 17 00:00:00 2001
From: THIS ONE IS A LITTLE BIT TRICKY KRUB
Date: Mon, 14 Oct 2024 17:53:35 +0700
Subject: [PATCH 21/27] Refactor Apply page component to adjust left margin for
company information section and add support for project pitch file
---
src/app/business/apply/page.tsx | 34 ++++++++++++++++++++++++++-------
1 file changed, 27 insertions(+), 7 deletions(-)
diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx
index d39381c..2b4fd0c 100644
--- a/src/app/business/apply/page.tsx
+++ b/src/app/business/apply/page.tsx
@@ -29,6 +29,7 @@ export default function Apply() {
const [applyProject, setApplyProject] = useState(false);
const [selectedImages, setSelectedImages] = useState([]);
const [businessPitchFile, setBusinessPitchFile] = useState("");
+ const [projectPitchFile, setProjectPitchFile] = useState("");
const MAX_FILE_SIZE = 5000000;
const ACCEPTED_IMAGE_TYPES = ["image/jpeg", "image/jpg", "image/png"];
const createPitchDeckSchema = (inputType: string) => {
@@ -535,6 +536,7 @@ export default function Apply() {
: "https:// "
}
accept={businessPitch === "file" ? ".md" : undefined}
+ // if text use normal register
{...(businessPitch === "text"
? register("businessPitchDeck", { required: true })
: {
@@ -737,9 +739,17 @@ export default function Apply() {
: "https:// "
}
accept={projectPitch === "file" ? ".md" : undefined}
- {...registerSecondForm("projectPitchDeck", {
- required: true,
- })}
+ {...(projectPitch === "text"
+ ? registerSecondForm("businessPitchDeck", {
+ required: true,
+ })
+ : {
+ onChange: (e) => {
+ const file = e.target.files?.[0];
+ setValueProject("businessPitchDeck", file);
+ setProjectPitchFile(file?.name || "");
+ },
+ })}
/>
Please upload a file or paste a link to your pitch, which
@@ -749,6 +759,20 @@ export default function Apply() {
make it stand out.
+ {projectPitchFile && (
+
+ 1. {projectPitchFile}
+ {
+ setValueProject("businessPitchDeck", null);
+ setProjectPitchFile("");
+ }}
+ >
+ Remove
+
+
+ )}
{errorsProject.projectPitchDeck && (
@@ -774,10 +798,6 @@ export default function Apply() {
registerSecondForm("projectLogo").onChange({
target: { name: "projectLogo", value: file },
});
- // Set the file value directly in the form
- registerSecondForm("projectLogo").onChange({
- target: { name: "projectLogo", value: file },
- });
}}
/>
From ba6a785c71ef9138748c69c46c1acf2cc9d45f8a Mon Sep 17 00:00:00 2001
From: sirin
Date: Mon, 14 Oct 2024 18:36:57 +0700
Subject: [PATCH 22/27] feat: retrive profile base on user_id
---
src/app/(user)/profile/{ => [uid]}/page.tsx | 19 +++----------------
src/components/navigationBar/profileBar.tsx | 6 +++---
2 files changed, 6 insertions(+), 19 deletions(-)
rename src/app/(user)/profile/{ => [uid]}/page.tsx (90%)
diff --git a/src/app/(user)/profile/page.tsx b/src/app/(user)/profile/[uid]/page.tsx
similarity index 90%
rename from src/app/(user)/profile/page.tsx
rename to src/app/(user)/profile/[uid]/page.tsx
index ceecf73..b45fd9f 100644
--- a/src/app/(user)/profile/page.tsx
+++ b/src/app/(user)/profile/[uid]/page.tsx
@@ -1,5 +1,3 @@
-// components/ProfilePage.tsx
-
import React from "react";
import Image from "next/image";
import { createSupabaseClient } from "@/lib/supabase/serverComponentClient";
@@ -10,22 +8,11 @@ import ReactMarkdown from "react-markdown";
interface Profile extends Tables<"Profiles"> {}
-export default async function ProfilePage() {
+export default async function ProfilePage({ params }: { params: { uid: string } }) {
const supabase = createSupabaseClient();
+ const uid = params.uid;
- const {
- data: { user },
- } = await supabase.auth.getUser();
-
- if (!user) {
- return (
-
- );
- }
-
- const { data: profileData, error } = await getUserProfile(supabase, user.id);
+ const { data: profileData, error } = await getUserProfile(supabase, uid);
if (error) {
return (
diff --git a/src/components/navigationBar/profileBar.tsx b/src/components/navigationBar/profileBar.tsx
index 41b31b9..e701ddb 100644
--- a/src/components/navigationBar/profileBar.tsx
+++ b/src/components/navigationBar/profileBar.tsx
@@ -32,7 +32,7 @@ const UnAuthenticatedComponents = () => {
);
};
-const AuthenticatedComponents = () => {
+const AuthenticatedComponents = ({ uid }: { uid: string }) => {
let notifications = 100;
const displayValue = notifications >= 100 ? "..." : notifications;
return (
@@ -58,7 +58,7 @@ const AuthenticatedComponents = () => {
- Profile
+ Profile
Settings
@@ -88,7 +88,7 @@ export function ProfileBar() {
<>
{sessionLoaded ? (
user ? (
-
+
) : (
)
From 912c05d1dab8aa2c75d2389c36bd9b01cb483888 Mon Sep 17 00:00:00 2001
From: sirin
Date: Mon, 14 Oct 2024 18:37:28 +0700
Subject: [PATCH 23/27] fix: foreign_key error on project status inner join
---
src/lib/data/projectQuery.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/data/projectQuery.ts b/src/lib/data/projectQuery.ts
index f1a5d3c..6773363 100644
--- a/src/lib/data/projectQuery.ts
+++ b/src/lib/data/projectQuery.ts
@@ -130,7 +130,7 @@ function searchProjectsQuery(
published_time,
project_short_description,
card_image_url,
- ...project_status!project_project_status_id_fkey!inner (
+ ...project_status!inner (
project_status:value
),
...project_investment_detail!inner (
From f5b4d99f4b7cc34596c28068b2019f7187902ed7 Mon Sep 17 00:00:00 2001
From: THIS ONE IS A LITTLE BIT TRICKY KRUB
Date: Mon, 14 Oct 2024 21:24:15 +0700
Subject: [PATCH 24/27] Refactor Apply page component to adjust left margin for
company information section and simplify project photo handling
---
src/app/business/apply/page.tsx | 91 ++++++++++++++++++---------------
1 file changed, 50 insertions(+), 41 deletions(-)
diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx
index 2b4fd0c..8c53e27 100644
--- a/src/app/business/apply/page.tsx
+++ b/src/app/business/apply/page.tsx
@@ -44,7 +44,7 @@ export default function Apply() {
return z
.custom(
(val) => {
- // Confirm val is a File object
+ // confirm val is a File object
return val instanceof File; // Ensure it is a File instance
},
{
@@ -61,7 +61,7 @@ export default function Apply() {
return z.any(); // avoid undefined
}
};
- const projectLogoSchema = z
+ const imageSchema = z
.custom(
(val) => val && typeof val === "object" && "size" in val && "type" in val,
{ message: "Input must be a file." }
@@ -88,25 +88,11 @@ export default function Apply() {
message: "Short description must be at least 10 characters.",
}),
projectPitchDeck: createPitchDeckSchema(projectPitch),
- projectLogo: projectLogoSchema,
+ projectLogo: imageSchema,
- // projectPhotos: z
- // .array(
- // z.object({
- // file: z
- // .any()
- // .refine(
- // (file) => file?.size <= MAX_FILE_SIZE,
- // `Max image size is 5MB.`
- // )
- // .refine(
- // (file) => ACCEPTED_IMAGE_TYPES.includes(file?.type),
- // "Only .jpg, .jpeg, and .png formats are supported."
- // ),
- // })
- // )
- // .min(1, "You must upload at least one photo.")
- // .max(10, "You can upload a maximum of 10 photos."),
+ projectPhotos: z
+ .array(z.instanceof(File))
+ .min(1, "At least one project photo is required"),
minInvest: z
.number({
required_error: "Minimum invesment must be a number.",
@@ -210,20 +196,36 @@ export default function Apply() {
register("isGenerating");
}, [register]);
- const handleRemoveImage = (index: number) => {
- const updatedImages = selectedImages.filter((_, i) => i !== index);
- setSelectedImages(updatedImages);
- };
const handleFileChange = (event: React.ChangeEvent) => {
if (event.target.files) {
const filesArray = Array.from(event.target.files);
- setSelectedImages((prevImages) => [...prevImages, ...filesArray]);
- setValueProject("projectPhotos", filesArray);
+ setSelectedImages((prevImages) => {
+ const updatedImages = [...prevImages, ...filesArray];
+ console.log("Updated Images Array:", updatedImages);
+ // ensure we're setting an array of File objects
+ setValueProject("projectPhotos", updatedImages);
+ return updatedImages;
+ });
}
};
+ const handleRemoveImage = (index: number) => {
+ setSelectedImages((prevImages) => {
+ const updatedImages = prevImages.filter((_, i) => i !== index);
+ console.log("After removal - Updated Images:", updatedImages);
+ // ensure we're setting an array of File objects
+ setValueProject("projectPhotos", updatedImages);
+ return updatedImages;
+ });
+ };
+
+ const ensureArrayValue = (value: any): File[] => {
+ if (Array.isArray(value)) return value;
+ if (value instanceof File) return [value];
+ return [];
+ };
+
const transformChoice = (data: any) => {
- // console.table(data);
// convert any yes and no to true or false
const transformedData = Object.entries(data).reduce(
(acc: Record, [key, value]) => {
@@ -287,16 +289,23 @@ export default function Apply() {
};
const onSubmitSingleForm = (data: any) => {
- const pitchDeckSchema = createPitchDeckSchema(businessPitch); // Ensure you create the schema dynamically
- pitchDeckSchema.parse(data.businessPitchDeck); // Validate the specific field
+ const pitchDeckSchema = createPitchDeckSchema(businessPitch);
+ pitchDeckSchema.parse(data.businessPitchDeck);
console.log("Valid form input:", data);
alert(JSON.stringify(data));
};
const onSubmitBothForms = (firstFormData: any, secondFormData: any) => {
+ const formattedSecondFormData = {
+ ...secondFormData,
+ projectPhotos: ensureArrayValue(secondFormData.projectPhotos),
+ };
alert(JSON.stringify(firstFormData));
- alert(JSON.stringify(secondFormData));
- console.log("Both forms submitted:", { firstFormData, secondFormData });
+ alert(JSON.stringify(formattedSecondFormData));
+ console.log("Both forms submitted:", {
+ firstFormData,
+ formattedSecondFormData,
+ });
};
const handleSubmitForms = (firstFormData: any) => {
@@ -740,13 +749,13 @@ export default function Apply() {
}
accept={projectPitch === "file" ? ".md" : undefined}
{...(projectPitch === "text"
- ? registerSecondForm("businessPitchDeck", {
+ ? registerSecondForm("projectPitchDeck", {
required: true,
})
: {
onChange: (e) => {
const file = e.target.files?.[0];
- setValueProject("businessPitchDeck", file);
+ setValueProject("projectPitchDeck", file);
setProjectPitchFile(file?.name || "");
},
})}
@@ -765,7 +774,7 @@ export default function Apply() {
{
- setValueProject("businessPitchDeck", null);
+ setValueProject("projectPitchDeck", "");
setProjectPitchFile("");
}}
>
@@ -811,13 +820,12 @@ export default function Apply() {
{errorsProject.projectLogo.message as string}
)}
- {/* Project Photos
- */}
- {/* {errorsProject.projectPhotos && (
+
+ {errorsProject.projectPhotos && (
{errorsProject.projectPhotos.message as string}
- )} */}
- {/* Minimum Investment */}
+ )}
+ {/* Minimum Investment */}
Minimum investment
From 0783ff5d6423f9f397720ad2f336f3bab11c91db Mon Sep 17 00:00:00 2001
From: sirin
Date: Mon, 14 Oct 2024 22:31:32 +0700
Subject: [PATCH 25/27] fix: error on multiple files upload
---
src/app/business/apply/page.tsx | 325 ++++++++++----------------------
1 file changed, 98 insertions(+), 227 deletions(-)
diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx
index 8c53e27..b4dbe73 100644
--- a/src/app/business/apply/page.tsx
+++ b/src/app/business/apply/page.tsx
@@ -7,12 +7,7 @@ import { createSupabaseClient } from "@/lib/supabase/clientComponentClient";
import { useEffect, useState } from "react";
import { Textarea } from "@/components/ui/textarea";
import { useForm } from "react-hook-form";
-import {
- Tooltip,
- TooltipContent,
- TooltipProvider,
- TooltipTrigger,
-} from "@/components/ui/tooltip";
+import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
import { z } from "zod";
import { zodResolver } from "@hookform/resolvers/zod";
import { DualOptionSelector } from "@/components/dualSelector";
@@ -62,10 +57,9 @@ export default function Apply() {
}
};
const imageSchema = z
- .custom(
- (val) => val && typeof val === "object" && "size" in val && "type" in val,
- { message: "Input must be a file." }
- )
+ .custom((val) => val && typeof val === "object" && "size" in val && "type" in val, {
+ message: "Input must be a file.",
+ })
.refine((file) => file.size < MAX_FILE_SIZE, {
message: "File can't be bigger than 5MB.",
})
@@ -90,9 +84,19 @@ export default function Apply() {
projectPitchDeck: createPitchDeckSchema(projectPitch),
projectLogo: imageSchema,
- projectPhotos: z
- .array(z.instanceof(File))
- .min(1, "At least one project photo is required"),
+ projectPhotos: z.custom(
+ (value) => {
+ console.log("Tozod", value);
+ if (value instanceof FileList || Array.isArray(value)) {
+ if (value.length === 1) {
+ return false;
+ }
+ return Array.from(value).every((item) => item instanceof File);
+ }
+ return false;
+ },
+ { message: "Must be a FileList or an array of File objects with at least one file." }
+ ),
minInvest: z
.number({
required_error: "Minimum invesment must be a number.",
@@ -179,15 +183,7 @@ export default function Apply() {
resolver: zodResolver(projectFormSchema),
});
- const communitySize = [
- "N/A",
- "0-5K",
- "5-10K",
- "10-20K",
- "20-50K",
- "50-100K",
- "100K+",
- ];
+ const communitySize = ["N/A", "0-5K", "5-10K", "10-20K", "20-50K", "50-100K", "100K+"];
useEffect(() => {
register("industry");
@@ -199,6 +195,7 @@ export default function Apply() {
const handleFileChange = (event: React.ChangeEvent) => {
if (event.target.files) {
const filesArray = Array.from(event.target.files);
+ console.log("first file", filesArray);
setSelectedImages((prevImages) => {
const updatedImages = [...prevImages, ...filesArray];
console.log("Updated Images Array:", updatedImages);
@@ -227,24 +224,21 @@ export default function Apply() {
const transformChoice = (data: any) => {
// convert any yes and no to true or false
- const transformedData = Object.entries(data).reduce(
- (acc: Record, [key, value]) => {
- if (typeof value === "string") {
- const lowerValue = value.toLowerCase();
- if (lowerValue === "yes") {
- acc[key] = true;
- } else if (lowerValue === "no") {
- acc[key] = false;
- } else {
- acc[key] = value; // keep other string values unchanged
- }
+ const transformedData = Object.entries(data).reduce((acc: Record, [key, value]) => {
+ if (typeof value === "string") {
+ const lowerValue = value.toLowerCase();
+ if (lowerValue === "yes") {
+ acc[key] = true;
+ } else if (lowerValue === "no") {
+ acc[key] = false;
} else {
- acc[key] = value; // keep other types unchanged
+ acc[key] = value; // keep other string values unchanged
}
- return acc;
- },
- {}
- );
+ } else {
+ acc[key] = value; // keep other types unchanged
+ }
+ return acc;
+ }, {});
return transformedData;
};
const handleBusinessPitchChange = (type: string) => {
@@ -274,9 +268,7 @@ export default function Apply() {
};
const fetchIndustry = async () => {
- let { data: BusinessType, error } = await supabase
- .from("business_type")
- .select("value");
+ let { data: BusinessType, error } = await supabase.from("business_type").select("value");
if (error) {
console.error(error);
@@ -319,9 +311,7 @@ export default function Apply() {
}
};
const fetchProjectType = async () => {
- let { data: ProjectType, error } = await supabase
- .from("project_type")
- .select("value");
+ let { data: ProjectType, error } = await supabase.from("project_type").select("value");
if (error) {
console.error(error);
@@ -344,12 +334,10 @@ export default function Apply() {
- All information submitted in this application is for internal use
- only and is treated with the utmost{" "}
+ All information submitted in this application is for internal use only and is treated with the utmost{" "}
- confidentiality. Companies may apply to raise with B2DVentures more
- than once.
+ confidentiality. Companies may apply to raise with B2DVentures more than once.
@@ -358,8 +346,7 @@ export default function Apply() {
About your company
- ** All requested
- information in this section is required.
+ ** All requested information in this section is required.
{/* company name */}
@@ -369,12 +356,7 @@ export default function Apply() {
Company name
-
+
This should be the name your company uses on your
website and in the market.
@@ -383,9 +365,7 @@ export default function Apply() {
{errorsBusiness.companyName && (
{errorsBusiness.companyName && (
-
- {errorsBusiness.companyName.message as string}
-
+ {errorsBusiness.companyName.message as string}
)}
)}
@@ -397,16 +377,12 @@ export default function Apply() {
fieldName="industry"
choices={industry}
handleFunction={handleBusinessFieldChange}
- description={
- <>Choose the industry that best aligns with your business.>
- }
+ description={<>Choose the industry that best aligns with your business.>}
placeholder="Select an industry"
selectLabel="Industry"
/>
{errorsBusiness.industry && (
-
- {errorsBusiness.industry.message as string}
-
+ {errorsBusiness.industry.message as string}
)}
{/* How much money has your company raised to date? */}
@@ -424,15 +400,12 @@ export default function Apply() {
})}
/>
- The sum total of past financing, including angel or venture{" "}
-
+ The sum total of past financing, including angel or venture
capital, loans, grants, or token sales.
{errorsBusiness.totalRaised && (
-
- {errorsBusiness.totalRaised.message as string}
-
+ {errorsBusiness.totalRaised.message as string}
)}
{/* Is your company incorporated in the United States? */}
@@ -449,20 +422,14 @@ export default function Apply() {
handleFunction={handleBusinessFieldChange}
description={
<>
- Only companies that are incorporated or formed in the US are{" "}
-
- eligible to raise via Reg CF. If your company is incorporated{" "}
-
+ 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.
>
}
value={isInUS}
/>
- {errorsBusiness.isInUS && (
-
- {errorsBusiness.isInUS.message as string}
-
- )}
+ {errorsBusiness.isInUS &&
{errorsBusiness.isInUS.message as string}
}
{/* Is your product available (for sale) in market? */}
- Only check this box if customers can access, use, or buy your{" "}
-
+ Only check this box if customers can access, use, or buy your
product today.
>
}
value={isForSale}
/>
{errorsBusiness.isForSale && (
-
- {errorsBusiness.isForSale.message as string}
-
+ {errorsBusiness.isForSale.message as string}
)}
{/* Is your company generating revenue?*/}
@@ -507,9 +471,7 @@ export default function Apply() {
value={isGenerating}
/>
{errorsBusiness.isGenerating && (
-
- {errorsBusiness.isGenerating.message as string}
-
+ {errorsBusiness.isGenerating.message as string}
)}
{/* Pitch deck */}
@@ -521,16 +483,14 @@ export default function Apply() {
type="button"
variant={businessPitch === "text" ? "default" : "outline"}
onClick={() => handleBusinessPitchChange("text")}
- className="w-32 h-12 text-base"
- >
+ className="w-32 h-12 text-base">
Paste URL
handleBusinessPitchChange("file")}
- className="w-32 h-12 text-base"
- >
+ className="w-32 h-12 text-base">
Upload a file
@@ -539,11 +499,7 @@ export default function Apply() {
type={businessPitch === "file" ? "file" : "text"}
id="pitchDeck"
className="w-96"
- placeholder={
- businessPitch === "file"
- ? "Upload your Markdown file"
- : "https:// "
- }
+ placeholder={businessPitch === "file" ? "Upload your Markdown file" : "https:// "}
accept={businessPitch === "file" ? ".md" : undefined}
// if text use normal register
{...(businessPitch === "text"
@@ -557,16 +513,12 @@ export default function Apply() {
})}
/>
- Your pitch deck and other application info will be used for{" "}
-
+ Your pitch deck and other application info will be used for
internal purposes only.
- Please make sure this document is publicly accessible. This
- can
+ Please make sure this document is publicly accessible. This can
be a DocSend, Box, Dropbox, Google Drive or other link.
-
- ** support only markdown(.md) format
-
+ ** support only markdown(.md) format
{/* box to show file name */}
@@ -578,17 +530,14 @@ export default function Apply() {
onClick={() => {
setValueBusiness("businessPitchDeck", null);
setBusinessPitchFile("");
- }}
- >
+ }}>
Remove
)}
{errorsBusiness.businessPitchDeck && (
-
- {errorsBusiness.businessPitchDeck.message as string}
-
+ {errorsBusiness.businessPitchDeck.message as string}
)}
{" "}
- 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.
+ 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.
>
}
placeholder="Select"
selectLabel="Select"
/>
{errorsBusiness.communitySize && (
-
- {errorsBusiness.communitySize.message as string}
-
+ {errorsBusiness.communitySize.message as string}
)}
-
setApplyProject(!applyProject)}
- >
+
setApplyProject(!applyProject)}>
- Would you like to apply for your first fundraising project
- as well?
+ 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 the tools
- necessary to raise funds.
+ Toggling this option allows you to begin your first project, which is crucial for unlocking
+ the tools necessary to raise funds.
@@ -647,14 +588,10 @@ export default function Apply() {
{/* header */}
-
- Begin Your First Fundraising Project
-
+
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.
+ 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.
{/* project's name */}
{errorsProject.projectName && (
-
- {errorsProject.projectName.message as string}
-
+
{errorsProject.projectName.message as string}
)}
{/* project type */}
Please specify the primary purpose of the funds>
- }
+ description={<>Please specify the primary purpose of the funds>}
placeholder="Select a Project type"
selectLabel="Project type"
/>
{errorsProject.projectType && (
-
- {errorsProject.projectType.message as string}
-
+ {errorsProject.projectType.message as string}
)}
{/* short description */}
@@ -698,21 +624,14 @@ export default function Apply() {
Short description
-
+
- Could you provide a brief description of your project {" "}
- in one or two sentences?
+ Could you provide a brief description of your project in one or two sentences?
{errorsProject.shortDescription && (
-
- {errorsProject.shortDescription.message as string}
-
+ {errorsProject.shortDescription.message as string}
)}
{/* Pitch deck */}
@@ -724,16 +643,14 @@ export default function Apply() {
type="button"
variant={projectPitch === "text" ? "default" : "outline"}
onClick={() => setProjectPitch("text")}
- className="w-32 h-12 text-base"
- >
+ className="w-32 h-12 text-base">
Paste URL
setProjectPitch("file")}
- className="w-32 h-12 text-base"
- >
+ className="w-32 h-12 text-base">
Upload a file
@@ -742,11 +659,7 @@ export default function Apply() {
type={projectPitch}
id="projectPitchDeck"
className="w-96"
- placeholder={
- projectPitch === "file"
- ? "Upload your Markdown file"
- : "https:// "
- }
+ placeholder={projectPitch === "file" ? "Upload your Markdown file" : "https:// "}
accept={projectPitch === "file" ? ".md" : undefined}
{...(projectPitch === "text"
? registerSecondForm("projectPitchDeck", {
@@ -761,11 +674,9 @@ export default function Apply() {
})}
/>
- Please upload a file or paste a link to your pitch, which
- should
- cover key aspects of your project: what it will do, what
- investors can expect to gain, and any highlights that
- make it stand out.
+ Please upload a file or paste a link to your pitch, which should
+ cover key aspects of your project: what it will do, what investors can expect to gain, and
+ any highlights that make it stand out.
{projectPitchFile && (
@@ -776,24 +687,18 @@ export default function Apply() {
onClick={() => {
setValueProject("projectPitchDeck", "");
setProjectPitchFile("");
- }}
- >
+ }}>
Remove
)}
{errorsProject.projectPitchDeck && (
-
- {errorsProject.projectPitchDeck.message as string}
-
+ {errorsProject.projectPitchDeck.message as string}
)}
{/* project logo */}
-
+
Project logo
@@ -810,21 +715,15 @@ export default function Apply() {
}}
/>
- Please upload the logo picture that best represents your
- project.
+ Please upload the logo picture that best represents your project.
{errorsProject.projectLogo && (
-
- {errorsProject.projectLogo.message as string}
-
+ {errorsProject.projectLogo.message as string}
)}
-
+
Project photos
@@ -834,31 +733,21 @@ export default function Apply() {
multiple
accept="image/*"
className="w-96"
- value={selectedImages.length === 0 ? "" : undefined}
{...registerSecondForm("projectPhotos", {
required: true,
onChange: handleFileChange,
})}
/>
- Feel free to upload any additional images that provide{" "}
-
+ Feel free to upload any additional images that provide
further insight into your project.
{selectedImages.map((image, index) => (
-
+
{image.name}
- handleRemoveImage(index)}
- className="ml-4"
- type="reset"
- >
+ handleRemoveImage(index)} className="ml-4" type="reset">
Remove
@@ -866,9 +755,7 @@ export default function Apply() {
{errorsProject.projectPhotos && (
-
- {errorsProject.projectPhotos.message as string}
-
+ {errorsProject.projectPhotos.message as string}
)}
{/* Minimum Investment */}
@@ -891,9 +778,7 @@ export default function Apply() {
{errorsProject.minInvest && (
-
- {errorsProject.minInvest.message as string}
-
+ {errorsProject.minInvest.message as string}
)}
{/* Target Investment */}
@@ -911,15 +796,12 @@ export default function Apply() {
})}
/>
- We encourage you to set a specific target investment {" "}
- amount that reflects your funding goals.
+ We encourage you to set a specific target investment amount that reflects your funding goals.
{errorsProject.targetInvest && (
-
- {errorsProject.targetInvest.message as string}
-
+