Skip to content

Fixed: Added click event on "Start Contest" on Landing + replace "Start Registration" button when logged in - #82

Merged
swarooppatilx merged 1 commit into
swarooppatilx:mainfrom
ZarrarPeshimam:fix/landing-ui
Sep 30, 2025
Merged

swarooppatilx merged 1 commit into
swarooppatilx:mainfrom
ZarrarPeshimam:fix/landing-ui

Conversation

@ZarrarPeshimam

Copy link
Copy Markdown
Contributor

Description:

This PR implements the changes described in the assigned issue to improve the Landing Page experience for both logged-in and unregistered users.

Close issue: #76


Changes Introduced:

  • Added userInfo check on the Landing Page using /api/userinfo to determine the user’s authentication status on mount.

  • Updated Start Contest button behavior:

    • Navigates to /home if the user is logged in.
    • Navigates to /login if the user is not logged in.
    • Button stays disabled until the rules checkbox is accepted.
  • Replaced the “Start Registration” button in the header with a rectangular blue badge showing
    ✔ Logged in as [username] when the user is authenticated (includes a tick icon on the left).

  • Added console logs to assist with debugging the authentication flow.


Why This Matters:

  • Creates a smoother user flow from Landing Page → Contest.
  • Prevents unregistered users from being stuck after pressing Start Contest.
  • Makes contest entry behavior consistent with authentication status.
  • Provides immediate visual feedback to logged-in users with a clear “Logged in as” label.

Preview:

  • ✅ When logged in: clicking Start Contest goes directly to /home.
  • 🔒 When not logged in: clicking Start Contest redirects to /login (with register option available).
  • 🖌 Header now shows a blue rectangular badge with tick + username instead of “Start Registration”.
bandicam.2025-09-11.12-30-52-416.mp4

Testing Steps:

  1. Log in → Visit Landing Page → Accept rules → Click Start Contest → Confirm navigation to /home.
  2. Log out → Visit Landing Page → Accept rules → Click Start Contest → Confirm navigation to /login.
  3. Observe header badge correctly shows username and tick when logged in.

@swarooppatilx, Please review my PR!!

@github-actions

Copy link
Copy Markdown

Thanks for creating a PR for your Issue! ☺️

We'll review it as soon as possible.
In the meantime, please double-check the file changes and ensure that all commits are accurate.

If there are any unresolved review comments, feel free to resolve them. 🙌🏼

@swarooppatilx swarooppatilx added gssoc25 GirlScript Summer of Code 2025 level2 GSSoC 2025 Level 2 labels Sep 30, 2025
@swarooppatilx
swarooppatilx merged commit 6606c63 into swarooppatilx:main Sep 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc25 GirlScript Summer of Code 2025 level2 GSSoC 2025 Level 2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants