fix: remove dead nav links, add About and Projects with alias-based routing
Overview
This MR delivers two major improvements to the SWECHA platform:
- A complete premium, motion-first article detail page for the POSH Awareness section
- A navigation cleanup that removes dead/broken links and replaces them with purposeful, content-backed routes
🗂 Changes
1. POSH Article Detail Page
A new dynamic article reading experience at /posh/article/:id, replacing the static document-style page.
New pages:
-
src/pages/PoshArticlePage.tsx— 3-column sticky layout with spotlight cursor glow,IntersectionObserverscroll-spy, thumbs-up/down feedback widget, embedded POSH report form, and sequential article navigation
New components (src/components/posh/):
-
ArticleHero.tsx— pinned scroll progress bar, word-by-word spring title reveal, breadcrumbs, author/date/read-time meta row -
ContentPanel.tsx— glassmorphic section wrapper with scroll-triggered blur→clear reveal,prefers-reduced-motionsupport -
PullQuote.tsx— gradient left-border editorial quote with slide-in animation -
StatBlock.tsx— viewport-triggered count-up animated stat cards (useInView) -
Callout.tsx— color-coded info / caution / important alert blocks with icons -
TOC.tsx— 3-mode responsive Table of Contents: sticky sidebar (desktop), sticky dropdown (tablet), bottom sheet drawer (mobile), with spring-animated active-section indicator -
ContextSidebar.tsx— Key Takeaways, Related Reading (auto-excludes current article), "File Secure Report" CTA -
UpNextCard.tsx— sequential article navigation card with hover expand animation
New data:
-
src/data/poshArticles.ts— mock article database with 3 articles: Prevention & Redressal Act, Bystander Intervention Guide, ICC Roles & Responsibilities — each with sections, stats, callouts, accordions, and takeaways
Modified:
-
src/App.tsx— registered dynamic route/posh/article/:id -
src/components/posh/PoshResources.tsx— resource library cards now navigate to article routes viauseNavigate -
src/components/posh/PoshReport.tsx— added form validation to pass unit test suite
2. Navigation Cleanup
| Before | After | Reason |
|---|---|---|
Mission → /
|
(removed) | Duplicate of brand logo link |
Library → /#explore
|
(removed) | Anchor-only, not a real page |
Community → /#community
|
(removed) | Broken — anchor does not exist in DOM |
| (new) |
About → /about
|
Real CMS content: Swecha founding story |
| (new) |
Projects → /projects
|
Real CMS content: flagship project showcase |
POSH Awareness → /posh
|
Unchanged |
src/services/api.ts — extended fetchPageById to support alias-based lookup (e.g. path segment "about" resolves to CMS page with alias: "/about"), enabling the new nav links to load content correctly through the existing PageView catch-all route.
✅ Quality Gates
| Check | Result |
|---|---|
npm run lint |
|
npm run test |
|
npm run build |
|
🔗 Live Routes (dev server)
| Route | Content |
|---|---|
/about |
About Swecha — founding story, Telugu OS, font work |
/projects |
Swecha Projects — Voice, Medical Camp, FSMI Android, Civic/Agri/Edu/Health Tech |
/posh/article/prevention-and-redressal-act |
Prevention & Redressal Act article |
/posh/article/bystander-intervention-guide |
Bystander Intervention article |
/posh/article/icc-roles-responsibilities |
ICC Roles & Responsibilities article |
📌 Notes for Reviewers
- Article data is currently mocked in
poshArticles.ts. When backend is ready, replace with API calls — the component interface is unchanged. - The
TOCcomponent uses three responsive modes; test on mobile (bottom drawer), tablet (dropdown), and desktop (sticky sidebar). -
fetchPageByIdnow performs two sequentialArray.find()calls (UUID first, alias second) — both are O(n) on the localpages.jsonarray and negligible in cost. When migrated to a real API, this can be replaced with a single parameterized query.