DeutschLernen/german-app-frontend
Lasse Rune Hansen 0609a298f1 fix(frontend/admin): Fix admin routing - remove duplicate AdminLayout wrappers
PROBLEM:
- /admin redirects to / (home page)
- Admin pages were wrapping themselves in <AdminLayout>
- This caused double-nested layout (header, nav, footer twice)

ROOT CAUSE:
Admin pages (AdminDashboardPage, AdminUsersPage, etc.) were individually wrapping
their content in <AdminLayout> component. But the App.tsx routing already renders
<AdminLayout> as the parent element for all /admin routes, and AdminLayout uses
<Outlet /> to render child routes.

This created a nested structure:
AppLayout -> AdminLayout (from routing) -> AdminLayout (from page) -> Page Content

SOLUTION:
- Removed <AdminLayout> wrappers from all admin pages
- AdminLayout now always uses <Outlet /> instead of {children || <Outlet />}
- Removed unused 'children' parameter from AdminLayout
- Admin pages now render directly in the Outlet of AdminLayout

CHANGES:
- AdminDashboardPage.tsx: Removed AdminLayout import and all <AdminLayout> tags
- AdminUsersPage.tsx: Removed AdminLayout import and all <AdminLayout> tags
- AdminUserDetailPage.tsx: Removed AdminLayout import and all <AdminLayout> tags
- AdminReportsPage.tsx: Removed AdminLayout import and all <AdminLayout> tags
- AdminStoryGeneratorPage.tsx: Removed AdminLayout import and all <AdminLayout> tags
- AdminLayout.tsx: Removed unused children parameter, always use <Outlet />

Now /admin will correctly render the AdminLayout with nested admin pages.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-14 20:05:44 +02:00
..
public Add complete solution: documentation, frontend, and project files 2026-05-31 18:20:53 +02:00
src fix(frontend/admin): Fix admin routing - remove duplicate AdminLayout wrappers 2026-06-14 20:05:44 +02:00
.dockerignore feat(backend/infra): add Docker configuration for Phase 3 2026-06-05 11:46:27 +02:00
.env.development feat(backend): Implement mandatory authentication and admin module 2026-06-14 12:42:15 +02:00
.gitignore Add complete solution: documentation, frontend, and project files 2026-05-31 18:20:53 +02:00
Dockerfile fix(frontend): remove health check from Dockerfile 2026-06-05 13:05:31 +02:00
eslint.config.js Add complete solution: documentation, frontend, and project files 2026-05-31 18:20:53 +02:00
index.html Add complete solution: documentation, frontend, and project files 2026-05-31 18:20:53 +02:00
nginx.conf fix(frontend/nginx): Add /audio/ proxy and fix /api/ proxy to backend 2026-06-14 08:00:25 +02:00
package-lock.json fix(frontend/story-integration): Fix TypeScript type imports and duplicate dictionary key 2026-06-13 16:25:17 +02:00
package.json feat(frontend/story-integration): Phase 6 - Frontend components for Story feature 2026-06-13 16:06:01 +02:00
README.md Add complete solution: documentation, frontend, and project files 2026-05-31 18:20:53 +02:00
tsconfig.app.json feat(backend): Implement mandatory authentication and admin module 2026-06-14 12:42:15 +02:00
tsconfig.json Add complete solution: documentation, frontend, and project files 2026-05-31 18:20:53 +02:00
tsconfig.node.json Add complete solution: documentation, frontend, and project files 2026-05-31 18:20:53 +02:00
vite.config.ts feat(backend): Implement mandatory authentication and admin module 2026-06-14 12:42:15 +02:00

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...

      // Remove tseslint.configs.recommended and replace with this
      tseslint.configs.recommendedTypeChecked,
      // Alternatively, use this for stricter rules
      tseslint.configs.strictTypeChecked,
      // Optionally, add this for stylistic rules
      tseslint.configs.stylisticTypeChecked,

      // Other configs...
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])

You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:

// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...
      // Enable lint rules for React
      reactX.configs['recommended-typescript'],
      // Enable lint rules for React DOM
      reactDom.configs.recommended,
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])