You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Persist projects into global state. Team member email list (teamMembers) determines who can edit the project via HackerProject screen.
Components and Data Flow
src/components/HackerProject.tsx
Purpose: Create/Edit a hacker’s project.
State binding:
Loads the current user’s project by checking if currentUser.email is included in any project.teamMembers.
All project fields (name, description, links, tags, challenges, team members) bind to local component state and are saved to global state with createProject or updateProject.
Team management:
Add/remove/update team members by email.
After adding a teammate’s email, they can edit the same project since HackerProject checks membership by teamMembers.includes(currentUser.email).
Shows a guidance banner if the user is solo (only one non-empty email).
Constraints:
teamName is optional; the UI does not enforce it.
Profile completion banner:
A clickable banner prompts “Complete your profile”; clicking opens ProfileEditor.
An X dismiss button persists dismissal to localStorage with a key per-user (profile-banner-dismissed-<email>).
src/components/ProfileEditor.tsx
Purpose: Edit the current user’s profile and identity.
Prefill: firstName/lastName are populated from the matching attendee (if found) or split from currentUser.name.
Fields: First name, Last name, City, LinkedIn, Twitter, Bio, and tag-like Other Projects (renamed to "Add Tags").
Save: Calls updateUserProfile with { profile, name, firstName, lastName } so both currentUser and the matching Attendee record are updated in global state.
Dashboards
src/components/HostDashboard.tsx
src/components/SponsorDashboard.tsx
Both dashboards show a clickable, dismissible “Complete your profile” banner (same behavior as project page).
Non-onboarding back buttons were removed; back navigation is handled at the app shell (HackathonInterface) and appears only during onboarding.
Lists, stats, and tables are derived from global state (projects, attendees, bounties, challenges, goodies).
Any UI not backed by state has been removed/avoided.
src/components/HackathonInterface.tsx
Back button: Shown only during onboarding screens (hostLogin, sponsorLogin, hackerSignup, projectQuestions, projectSetup). Positioned bottom-left.
Screen routing: Directs between major app screens and passes data through formData or hostDashboardData where required.
How to Collaborate on Projects
Adding teammates:
In the project page, add teammates by entering their email under Team Members.
Saving persists to global state; the added teammate (when logged in with that email) will be able to edit the same project.
Joining an existing project:
You must ask the project creator to add your email to their project’s Team Members list.
Once added, refresh or revisit the project page to load the project for your account.
Removing a teammate:
Use the remove button next to a team member email; save to persist the change.
Persistence
Session: Provider stores a session with user and datasets in localStorage. The closable profile banner also stores a per-user dismissal flag in localStorage.
Notes and Guarantees
teamName is optional and not required to save a project.
Project editing rights are determined solely by email membership in teamMembers.
Profile changes update both the currentUser and corresponding Attendee record for consistency across dashboards.