-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] introduces simple onboarding form #16
[feat] introduces simple onboarding form #16
Conversation
IJP-19 Simple create profile form.
Routes:
Task: Create a simple, unstyled form to create a new profile. Include text entry boxes for just the following profile attributes:
IJP-29 is complete, so the name should now be part of the profile schema. Make sure you pull the latest (The way the other attributes will be handled is pending more information from Ambreen, so we will not write any code for that right now.) Generate a random Add a submit button at the bottom. When the button is pressed, call the method you wrote in |
src/app/profile/page.tsx
Outdated
@@ -40,6 +40,8 @@ export default function Page() { | |||
await updateProfile(mockProfile.user_id, { | |||
hours_per_week: 100, // Update the roles field with new data | |||
}); | |||
|
|||
console.log('test'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to delete all console.log's before merging!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ma'am yes ma'am
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking really good! The profile pages isn't working for me (which would be nice to fix), but create-profile is working! Just make sure that we're requiring them to input both first and last name (see comment) :)
src/app/profile/page.tsx
Outdated
@@ -51,18 +53,17 @@ export default function Page() { | |||
{profiles.map(profile => ( | |||
<li key={profile.user_id}> | |||
<h2>Profile ID: {profile.user_id}</h2> | |||
<p>First Name: {profile.first_name}</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I ask what this function does, and why we are deleting the First Name and Last Name?
Is it because we're now collecting First and Last Name in the Create Profile page?
src/app/create-profile/page.tsx
Outdated
const [lastName, setLastName] = useState<string>(''); | ||
|
||
const handleInsert = async () => { | ||
if (!firstName && !lastName) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we allowing users to not input a first name or a last name? This line allows user to have either first or last (rather than requiring them to have both). Change to !firstName || !lastName
if we want to require both first and last?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh such good feedback THANKS!!
@@ -40,6 +40,8 @@ export default function Page() { | |||
await updateProfile(mockProfile.user_id, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
github is not letting me comment on the actual line lol but can we comment out line 38, i.e.
await insertProfile(mockProfile);
as part of this PR?
cc @jinkang-0 on this thread
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes ma'am
I resolved the merge conflict with |
Looking great rahi!!! great work! |
d368c48
to
80d9fa4
Compare
🎋 Description
This PR creates a simple "create profile" form, that takes first/last names and then inserts a corresponding profile row to the profiles table in supabase.
🌴 What's new in this PR
🌲 Screenshots
🌳 How to review
🌱 Next steps
We're going to need to expand this form to take in more values for the other attributes of the user profile, and it will also obviously need formatting and styling.
🔗 Relevant Links
ℹ️ Online sources
🪴 Related PRs
CC: @pragyakallanagoudar