Skip to content

fix: replace inline HTML on /unauthorized route with proper page component#466

Open
Jyoti1-pog wants to merge 1 commit into
viru0909-dev:mainfrom
Jyoti1-pog:fix/unauthorized-page-component
Open

fix: replace inline HTML on /unauthorized route with proper page component#466
Jyoti1-pog wants to merge 1 commit into
viru0909-dev:mainfrom
Jyoti1-pog:fix/unauthorized-page-component

Conversation

@Jyoti1-pog
Copy link
Copy Markdown

Description

The /unauthorized route in App.jsx rendered inline JSX (<div><h1>...)
instead of a dedicated, reusable page component. This replaces it with a
proper Unauthorized page that matches the app's design system.

Closes #283

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change
  • Documentation update

Changes

  • Added src/pages/Unauthorized.jsx — a reusable page component:
    • Consistent UI: uses the project's theme CSS variables
      (--bg-main, --color-primary, --shadow-glass, …), a card layout,
      framer-motion entrance animation, and a lucide-react icon —
      matching Disclaimer.jsx / Terms.jsx.
    • Navigation: "Back to Home" link (/) and a "Go Back" button
      (navigate(-1)).
    • i18n support: renders English/Hindi based on the existing
      useLanguage() context, so it follows the app-wide language toggle.
  • Updated src/App.jsx:
    • Lazy-imported the new component.
    • Replaced the 6 lines of inline JSX with <Route path="/unauthorized" element={<Unauthorized />} />.

Scope: only App.jsx was modified among existing files (per the issue).
i18n strings are kept inside the new component so the shared
LanguageContext.jsx is left untouched.

How to test

  1. Log in as any role (e.g. LITIGANT).
  2. Manually visit a route for a different role (e.g. /admin) — you are
    redirected to /unauthorized.
  3. Verify the styled page renders with both navigation buttons working.
  4. Toggle the language and confirm the text switches between English/Hindi.

Screenshots

Screenshot 2026-05-19 024035

@Jyoti1-pog Jyoti1-pog requested a review from viru0909-dev as a code owner May 18, 2026 22:02
@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

Someone is attempting to deploy a commit to the CodeBlooded's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nyaysetu Ready Ready Preview, Comment May 20, 2026 4:11pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: /unauthorized Route Uses Inline HTML Instead of Proper Component

1 participant