What this is for
RoleDashboards.tsx is a 3,100+ line file holding all 8 role dashboards. We're moving each one into its own file so the codebase is easier to navigate. This is the smallest dashboard — good place to start.
What to move
export const SchoolDashboard (~96 lines) — the dashboard shown to School/Principal-role users.
Steps
- Create
frontend/src/components/dashboards/SchoolDashboard.tsx.
- Cut the
SchoolDashboard component out of RoleDashboards.tsx and paste it into the new file.
- Add whatever imports it needs at the top (React, any icons/types it uses — copy the relevant ones from the top of
RoleDashboards.tsx).
- Keep the
export const SchoolDashboard = ... exactly as it was.
- Back in
RoleDashboards.tsx, where the component used to be, add: export { SchoolDashboard } from './dashboards/SchoolDashboard'; — this way App.tsx doesn't need any changes.
- Don't change any logic or JSX — copy it exactly as-is.
How to check your work
cd frontend && npm run lint — no errors.
npm run build — succeeds.
- Run
npm run dev, log in as a School/Principal user, and confirm the dashboard looks and behaves exactly the same as before.
Part of #136.
What this is for
RoleDashboards.tsxis a 3,100+ line file holding all 8 role dashboards. We're moving each one into its own file so the codebase is easier to navigate. This is the smallest dashboard — good place to start.What to move
export const SchoolDashboard(~96 lines) — the dashboard shown to School/Principal-role users.Steps
frontend/src/components/dashboards/SchoolDashboard.tsx.SchoolDashboardcomponent out ofRoleDashboards.tsxand paste it into the new file.RoleDashboards.tsx).export const SchoolDashboard = ...exactly as it was.RoleDashboards.tsx, where the component used to be, add:export { SchoolDashboard } from './dashboards/SchoolDashboard';— this wayApp.tsxdoesn't need any changes.How to check your work
cd frontend && npm run lint— no errors.npm run build— succeeds.npm run dev, log in as a School/Principal user, and confirm the dashboard looks and behaves exactly the same as before.Part of #136.