6d25a499b2
BREAKING CHANGE: Replaced all direct useNavigate() usage with HandleNavigate hook
## Summary
- Complete frontend navigation refactoring
- Centralized route management with routes.js
- Converted 18+ components to use HandleNavigate
- Enhanced navigation with 20+ type-safe functions
## New Files
- src/utils/routes.js - Central route constants and helpers
- Documentations/FRONTEND_CODING_GUIDELINES.md - Frontend best practices (300+ lines)
- Documentations/NAVIGATION_REFACTORING_REPORT.md - Detailed refactoring report (400+ lines)
## Modified Components (18+)
### Pages
- Home.jsx, LoginForm.jsx, RegisterForm.jsx
- ResetPassword.jsx, VerifyEmailPage.jsx
- DeckCreator.jsx, Card_display.jsx
- Lobby.jsx, GameTest.jsx, ChooseDeck.jsx, PlayerSetup.jsx
- Landingpage.jsx
### Components
- Userdetails.jsx, DeckInfoPopUp.jsx
- PlayMenu.jsx, LandingPage.jsx, DeckManager.jsx
### Hooks
- useRequireAuth.jsx
### Core
- App.jsx - Route constants integration
- HandleNavigate.jsx - Enhanced with 20+ navigation functions
## Key Improvements
Type-safe navigation (goDeckDetails(id) vs navigate('/deck/'+id))
Automatic scroll management
Centralized state passing
Single source of truth for routes
Backwards compatibility aliases
Zero compile errors
Production ready
## Validation
- useNavigate: Only in HandleNavigate.jsx
- navigate() calls: 0 direct usage
- Compile errors: 0
- Documentation: Complete
29 lines
1.0 KiB
React
29 lines
1.0 KiB
React
// src/pages/Landing/Landingpage.jsx
|
|
// Főoldal - Landing Page
|
|
|
|
|
|
import Navbar from "../../components/Navbar/Navbar"
|
|
import Footer from "../../components/Footer/Footer.jsx"
|
|
import Background from "../../assets/backgrounds/Background.jsx"
|
|
import LandingPage from "../../components/Landingpage/LandingPage.jsx"
|
|
import HandleNavigate from "../../utils/HandleNavigate/HandleNavigate.jsx"
|
|
|
|
export default function LandingPageMain() {
|
|
const { goHome, goLogin, goContacts, goAuth } = HandleNavigate()
|
|
|
|
return (
|
|
<div className="w-full min-h-screen flex flex-col relative overflow-x-hidden">
|
|
<div className="fixed inset-0 -z-10 pointer-events-none">
|
|
<Background />
|
|
</div>
|
|
<div className="fixed top-0 left-0 right-0 z-30">
|
|
<Navbar />
|
|
</div>
|
|
<main className="flex-1 flex flex-col items-center justify-start py-15 min-h-0 mt-[64px]">
|
|
<LandingPage onNavigateToContacts={goContacts} onNavigateToPlay={goLogin} onNavigateToAuth={goAuth} onNavigateToGame={goHome} />
|
|
</main>
|
|
<Footer />
|
|
</div>
|
|
);
|
|
}
|