Skip to content

Malformed JSX in AdminHome.jsx breaks frontend build #22

Description

@teja-311

Bug Description

The frontend fails to build/run due to a JSX syntax error.

Error

X [ERROR] Expected ")" but found "variant"
src/components/admin/AdminHome.jsx:133:10

Root Cause

In frontend/src/components/admin/AdminHome.jsx, the <nav> containing the dashboard tab buttons (Users / Payments / Activity Logs) is malformed. The "Activity Logs" button is missing its opening <Button tag, and appears to have been merged incorrectly with a second, duplicate <nav> block. This also splits what should be a single three-way conditional (payments / activity-logs / default users) into two separate, broken conditional blocks:

{activeSection === "payments" ? (
  <PaymentRecords />
    variant={
      activeSection === "activity-logs" ? "contained" : "outlined"
    }
    ...
  </Button>
</nav>

{activeSection === "activity-logs" ? (
  <ActivityLogs />
) : (
  <section ...>

Proposed Fix

Merge into a single <nav> with all three buttons properly opened/closed, and combine the conditionals into one clean three-way check:

<nav aria-label="Admin dashboard sections" style={{ ... }}>
  <Button variant={activeSection === "users" ? "contained" : "outlined"} ... >Users</Button>
  <Button variant={activeSection === "payments" ? "contained" : "outlined"} ... >Payments</Button>
  <Button variant={activeSection === "activity-logs" ? "contained" : "outlined"} ... >Activity Logs</Button>
</nav>

{activeSection === "payments" ? (
  <PaymentRecords />
) : activeSection === "activity-logs" ? (
  <ActivityLogs />
) : (
  <section ...>
    ...

Confirmed the frontend builds and runs cleanly after this fix. Happy to open a PR if assigned.

Metadata

Metadata

Assignees

Labels

ECSoC26Required label for a PR to be eligible for Sentinel scoringbugSomething broken or not working as described

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions