Skip to content

BSL 32 Startup Wiring#41

Open
shreyaanchhabra wants to merge 10 commits intomainfrom
bsl-32-startupwiring
Open

BSL 32 Startup Wiring#41
shreyaanchhabra wants to merge 10 commits intomainfrom
bsl-32-startupwiring

Conversation

@shreyaanchhabra
Copy link
Copy Markdown
Contributor

No description provided.

Comment on lines +44 to +49
body: JSON.stringify({
StartupName : form.name,
StartupDescription : form.description,
StartupFundingGoal : form.fundingGoal,
StartupContact : form.contact,
}),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submitterEmail: StartupContact?.email ?? StartupContact?.Email ?? null,

Make startup contact as:

  StartupContact: {
    email: form.contact,
    name: form.name,
  },

StartupContact is sent as a plain string but the API derives submitterEmail as StartupContact?.email
So send StartupContact as an object (email: form.contact, form: form.name} so the API can correctly populate subitterEmail and submitterName

Comment on lines +44 to +49
body: JSON.stringify({
StartupName : form.name,
StartupDescription : form.description,
StartupFundingGoal : form.fundingGoal,
StartupContact : form.contact,
}),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the form has 6 fields including deckURL and fundingSiteURL
but it is never included in the request body and seem to just be silently dropped.
So add StartupDeckUrl: form.deckUrl and StartupFundingSiteUrl: form.fundingSiteUrl to the payload

</div>

<div className="flex justify-center pt-4">
<Button type="submit">Apply</Button>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are tracking status but not really using it I believe. The user should get some sort of visual feedback after submitting (like a success or error message).
So add a conditional render for status == "success" (green) or status == "error" (red)

AI generated this for inspiration:

{status === "success" && (
  <p className="text-green-600 text-sm text-center">
    Application submitted successfully!
  </p>
)}
{status === "error" && (
  <p className="text-red-600 text-sm text-center">
    Something went wrong. Please try again.
  </p>
)}

</div>

<div className="flex justify-center pt-4">
<Button type="submit">Apply</Button>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you also track loading, but you should apply it to Button so that the submit button does NOT stay clickable throughout the request (which would allow u to submit multiple times).

So you can make it something like this:

<Button type="submit" disabled={loading}>
  {loading ? "Submitting..." : "Apply"}
</Button>

Comment on lines +55 to +59
setForm({
name: "",
description: "",
fundingGoal: "",
contact: "",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add deckUrl and fundingSiteUrl if we are adding this as inputs as I mentioned above

</section>
<div className="relative z-10 flex flex-col sm:flex-row gap-6 mt-10 w-full max-w-4xl justify-center">
{cards.map((card) => (
<a
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use from next/link instead of <a> for internal routes. Raw <a> tags trigger a full page reload and skip client-side routing and prefetching.

const cards = [
{ id: "startup", label: "STARTUP\nAPPLICATION", href: "/apply/startup" },
{ id: "org", label: "ORG/COMPANY\nPROJECT FORM", href: "/apply/org" },
{ id: "student", label: "STUDENT/PRODUCT\nTEAM SKILLS FORM [Mock for now]", href: "#" },
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove [Mock for now] and add the href to /apply/team

<a
href={link.href}
className="text-black no-underline text-lg border-b-2 border-transparent hover:border-black transition-colors duration-200"
></a>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does anything show up here? I think you need a {link.label}

like:

<a
  href={link.href}
  className="text-black no-underline text-lg ..."
>{link.label}</a>

@@ -1,3 +1,5 @@
'use client';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you can remove 'use client' here ..

}}
>
<Image
<img
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use Image from next/Image .. it provides better optimizations .. it looks like you use to use it but it got removed? is there a reason for that? or did I mess up something in the merge conflict resolutions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants