Fix/registration flow and UI#12
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request fixes the registration flow and improves UI consistency, particularly for dark mode support. The changes focus on migrating old users who were stuck in legacy registration states, enhancing form styling, and improving the overall user experience.
Key Changes:
- Migrates users from legacy registration states (
paymentPending,notYetTeamMember) by auto-updating their database records and redirecting them to the dashboard - Adds comprehensive dark mode styling support across registration forms, profile pages, and timeline with proper text colors and backgrounds
- Makes images responsive by hiding decorative background images on smaller screens (below
lgbreakpoint)
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/Hero.tsx | Adds ProfileModal import and state (currently unused), updates link styling for dark mode, and hides background images on mobile/tablet devices |
| src/app/timeline/page.tsx | Attempts to add dark mode background (but incorrectly sets it to white) |
| src/app/register/style.css | Adds dark mode support for input fields and select dropdowns with proper color schemes |
| src/app/register/page.tsx | Implements user migration logic to auto-update legacy registration states, makes email field read-only, and adds comprehensive dark mode text styling to form inputs |
| src/app/profile/page.tsx | Improves dark mode support for profile page text elements and tab navigation |
| src/app/dashboard/page.tsx | Separates routing logic for incompleteRegistration and notYetTeamMember states |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import ProfileModal from './ProfileModal'; | ||
|
|
||
| export default function Hero() { | ||
| const [user, setUser] = useState<User | null>(null); | ||
| const [userProgress, setUserProgress] = useState<Progress | null>(null); | ||
| const [loading, setLoading] = useState(true); | ||
| const [showProfileModal, setShowProfileModal] = useState(false); |
There was a problem hiding this comment.
The showProfileModal state is initialized but never set to true anywhere in the component. This means the ProfileModal will never be displayed. Consider either removing this unused state and the ProfileModal component, or implementing the logic to trigger the modal (e.g., on first login or after certain user actions).
| import ProfileModal from './ProfileModal'; | |
| export default function Hero() { | |
| const [user, setUser] = useState<User | null>(null); | |
| const [userProgress, setUserProgress] = useState<Progress | null>(null); | |
| const [loading, setLoading] = useState(true); | |
| const [showProfileModal, setShowProfileModal] = useState(false); | |
| export default function Hero() { | |
| const [user, setUser] = useState<User | null>(null); | |
| const [userProgress, setUserProgress] = useState<Progress | null>(null); | |
| const [loading, setLoading] = useState(true); |
| export default function TimelinePage() { | ||
| return ( | ||
| <div className="min-h-screen bg-white dark:bg-black"> | ||
| <div className="min-h-screen bg-white dark:bg-white"> |
There was a problem hiding this comment.
The dark mode class is set to dark:bg-white, which is the same as the light mode background. This defeats the purpose of dark mode. It should be dark:bg-black or another dark color to provide proper dark mode styling.
| <div className="min-h-screen bg-white dark:bg-white"> | |
| <div className="min-h-screen bg-white dark:bg-black"> |
| updateDoc(doc(db, "registrations", user.uid), { | ||
| payment_status: "captured", | ||
| isTeamMember: 0, // Ensure they are not stuck in "notYetTeamMember" | ||
| }).then(() => { | ||
| window.location.href = "/dashboard"; | ||
| }); |
There was a problem hiding this comment.
The database update operations lack error handling. If the update fails, the user will be left in an inconsistent state without any feedback. Add error handling to catch potential failures and inform the user appropriately.
| updateDoc(doc(db, "registrations", user.uid), { | ||
| isTeamMember: 0, | ||
| }).then(() => { | ||
| window.location.href = "/dashboard"; | ||
| }); |
There was a problem hiding this comment.
The database update operation lacks error handling. If the update fails, the user will be left in an inconsistent state without any feedback. Add error handling to catch potential failures and inform the user appropriately.
| value={formState.email} | ||
| onChange={handleChange} | ||
| className="register-input grow md:w-1/2 " | ||
| className="register-input grow md:w-1/2 text-gray-900 dark:text-white placeholder:text-gray-500 dark:placeholder:text-gray-400 opacity-70 cursor-not-allowed bg-gray-100 dark:bg-gray-800" |
There was a problem hiding this comment.
The email input field is now set to readOnly, which improves user experience by preventing accidental email changes. However, the styling includes cursor-not-allowed and visual indicators of being disabled. Consider whether the field should be truly disabled (with the disabled attribute) instead of just readOnly, as readOnly fields are still focusable and may confuse users who see the disabled styling but can still interact with the field.
| className="register-input grow md:w-1/2 text-gray-900 dark:text-white placeholder:text-gray-500 dark:placeholder:text-gray-400 opacity-70 cursor-not-allowed bg-gray-100 dark:bg-gray-800" | |
| className="register-input grow md:w-1/2 text-gray-900 dark:text-white placeholder:text-gray-500 dark:placeholder:text-gray-400 bg-gray-100 dark:bg-gray-800" |
|
|
||
| case Progress.notYetTeamMember: | ||
| router.push("/profile"); | ||
| break; |
There was a problem hiding this comment.
The routing logic is inconsistent with the register page migration logic. The register page now automatically updates users in notYetTeamMember state (isTeamMember: -1) to isTeamMember: 0 and redirects them to /dashboard. However, the dashboard then redirects users with notYetTeamMember status to /profile, creating a potential inconsistency. Since the register page is migrating these users by setting isTeamMember: 0, they should no longer be in the notYetTeamMember state. Consider removing the notYetTeamMember case here, or ensure the migration logic in register page is also reflected in the GetUserProgress function.
| case Progress.notYetTeamMember: | |
| router.push("/profile"); | |
| break; |
| <p className="mt-3 text-lg text-gray-700 dark:text-gray-300">24-25th March 2026</p> | ||
|
|
||
| <p className="opacity-60 text-gray-700 dark:text-gray-300">Gandhi Institute of Technology and Management, Visakhapatnam</p> | ||
| <p className="text-gray-700 dark:text-gray-300">Gandhi Institute of Technology and Management, Visakhapatnam</p> |
There was a problem hiding this comment.
The removal of opacity-60 from these text elements improves readability. However, the paragraph elements lack sufficient distinction from the heading. Consider adding some visual hierarchy through subtle opacity, font weight, or color variations to maintain a clear information hierarchy.
No description provided.