diff --git a/src/App.tsx b/src/App.tsx index 749c048..5967aed 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -9,9 +9,7 @@ import Dashboard from "./pages/learner/Dashboard"; import { Library } from "./pages/learner/Library"; import { CourseTimeline } from "./pages/learner/CourseTimeline"; import { Settings } from "./pages/Settings"; -import { WebinarListing } from "./pages/WebinarListing"; import { Surveys } from "./pages/Surveys"; -import { CorporateWebinars } from "./pages/CorporateWebinars"; export default function App() { return ( @@ -22,21 +20,12 @@ export default function App() { } /> } /> } /> - } /> - } /> + } /> + } /> } /> } /> } /> - {/* Legacy corporate routes (all re-use same components) */} - } /> - } /> - {/* } /> */} - } /> - {/* } /> */} - } /> - } /> - {/* Fallback */} } /> diff --git a/src/Guidelines.md b/src/Guidelines.md index 23e491f..82e40b0 100644 --- a/src/Guidelines.md +++ b/src/Guidelines.md @@ -64,14 +64,14 @@ ### Required Imports for Back Navigation ```tsx import { ArrowLeft } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); ``` ### Standard Navigation Handler ```tsx const handleBackNavigation = () => { // Choose appropriate navigation based on page context - navigateTo('/dashboard?view=individual'); // or /dashboard?view=corporate for corporate learners + navigate('/dashboard?view=individual'); // or /dashboard?view=corporate for corporate learners }; ``` diff --git a/src/assets/klc-logo.png b/src/assets/klc-logo.png new file mode 100644 index 0000000..ff70e16 Binary files /dev/null and b/src/assets/klc-logo.png differ diff --git a/src/components/FacilityShowcaseCard.tsx b/src/components/FacilityShowcaseCard.tsx index 7b35ed0..79cb5f8 100644 --- a/src/components/FacilityShowcaseCard.tsx +++ b/src/components/FacilityShowcaseCard.tsx @@ -3,7 +3,7 @@ import { Card, CardContent, CardHeader, CardTitle } from './ui/card'; import { Badge } from './ui/badge'; import { Button } from './ui/button'; import { ImageWithFallback } from './figma/ImageWithFallback'; -import { navigateTo } from './Router'; +import { navigate } from './Router'; import { Star, Users, @@ -197,7 +197,7 @@ export function FacilityShowcaseCard({ facility }: FacilityShowcaseCardProps) { navigateTo(`/facility/${facility.id}`)} + onClick={() => navigate(`/facility/${facility.id}`)} disabled={facility.availability === 'unavailable'} > {facility.availability === 'unavailable' ? 'Fully Booked' : 'View Details'} diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index d0259b1..d5a3d09 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Button } from './ui/button'; import klcLogo from 'figma:asset/c2d0a01da274cef655bbdfb1b11ff3e9993ea278.png'; -import { navigateTo } from './Router'; +import { navigate } from './Router'; import { Mail, Phone, @@ -136,7 +136,7 @@ export function Footer() { {section.links.map((link) => ( navigateTo(link.href)} + onClick={() => navigate(link.href)} className="text-sm text-muted-foreground hover:text-primary transition-colors text-left" > {link.name} @@ -157,13 +157,13 @@ export function Footer() { © 2025 Kautilya Leadership Centre. All rights reserved. navigateTo('/privacy')} + onClick={() => navigate('/privacy')} className="hover:text-primary transition-colors" > Privacy Policy navigateTo('/terms')} + onClick={() => navigate('/terms')} className="hover:text-primary transition-colors" > Terms of Service diff --git a/src/components/Navigation.tsx b/src/components/Navigation.tsx index 89bbc37..b4194af 100644 --- a/src/components/Navigation.tsx +++ b/src/components/Navigation.tsx @@ -19,7 +19,7 @@ import { SheetTrigger, } from './ui/sheet'; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from './ui/collapsible'; -import { navigateTo } from './Router'; +import { navigate } from './Router'; import { useAuth } from './AuthContext'; import klcLogo from 'figma:asset/209958db0c439ec78be82ab4f3e335a6aed5de89.png'; import exampleImage from 'figma:asset/6cae567b6bf6a44cb03b767e4308c4c705340d08.png'; @@ -111,18 +111,18 @@ export function Navigation({ currentPage }: NavigationProps) { }; const handleLogin = () => { - navigateTo('/auth'); // Route to login selection page + navigate('/auth'); // Route to login selection page setIsMobileMenuOpen(false); }; const handleSignup = () => { - navigateTo('/signup'); + navigate('/signup'); setIsMobileMenuOpen(false); }; const handleLogout = () => { signOut(); - navigateTo('/'); + navigate('/'); setActiveDropdown(null); setIsMobileMenuOpen(false); }; @@ -130,9 +130,9 @@ export function Navigation({ currentPage }: NavigationProps) { const handleAccountSignIn = (accountType: 'individual' | 'corporate') => { // Navigate to appropriate sign-in page for the account type if (accountType === 'individual') { - navigateTo('/login'); + navigate('/login'); } else { - navigateTo('/corporate/login'); + navigate('/corporate/login'); } setActiveDropdown(null); setIsMobileMenuOpen(false); @@ -267,7 +267,7 @@ export function Navigation({ currentPage }: NavigationProps) { {/* Logo */} navigateTo('/')} + onClick={() => navigate('/')} className="flex items-center space-x-2 focus:outline-none focus:ring-2 focus:ring-primary rounded-lg p-1 hover:bg-gray-50 transition-colors" aria-label="Go to KLC homepage" > @@ -303,7 +303,7 @@ export function Navigation({ currentPage }: NavigationProps) { { - navigateTo(subItem.href); + navigate(subItem.href); setActiveDropdown(null); }} className="w-full flex items-center space-x-3 px-4 py-3 text-[16px] text-gray-700 hover:bg-gray-50 hover:text-primary transition-colors text-left focus:outline-none focus:ring-2 focus:ring-primary" @@ -319,7 +319,7 @@ export function Navigation({ currentPage }: NavigationProps) { ))} navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[16px] text-foreground hover:text-primary transition-colors py-2 px-3 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-primary" > Contact @@ -462,7 +462,7 @@ export function Navigation({ currentPage }: NavigationProps) { navigateTo(learnerMenuItems[learnerMenuItems.length - 1].href)} + onClick={() => navigate(learnerMenuItems[learnerMenuItems.length - 1].href)} > Settings @@ -601,7 +601,7 @@ export function Navigation({ currentPage }: NavigationProps) { { - navigateTo(item.href); + navigate(item.href); setIsMobileMenuOpen(false); }} className="w-full flex items-center gap-3 px-3 py-2 text-left text-[16px] text-gray-700 hover:bg-gray-50 hover:text-primary rounded-lg transition-colors focus:outline-none focus:ring-2 focus:ring-primary min-h-[44px]" @@ -639,7 +639,7 @@ export function Navigation({ currentPage }: NavigationProps) { { - navigateTo(subItem.href); + navigate(subItem.href); setIsMobileMenuOpen(false); }} className="w-full flex items-center gap-3 px-3 py-2 text-left text-[16px] text-gray-600 hover:bg-gray-50 hover:text-primary rounded-lg transition-colors focus:outline-none focus:ring-2 focus:ring-primary min-h-[44px]" @@ -656,7 +656,7 @@ export function Navigation({ currentPage }: NavigationProps) { { - navigateTo('/contact'); + navigate('/contact'); setIsMobileMenuOpen(false); }} className="w-full flex items-center p-3 text-[16px] text-gray-900 hover:bg-gray-50 rounded-lg transition-colors text-left focus:outline-none focus:ring-2 focus:ring-primary min-h-[44px]" diff --git a/src/components/ProgrammeWizard.tsx b/src/components/ProgrammeWizard.tsx index 6eddd86..ffac2c5 100644 --- a/src/components/ProgrammeWizard.tsx +++ b/src/components/ProgrammeWizard.tsx @@ -3,7 +3,7 @@ import { Card, CardContent, CardHeader, CardTitle } from "./ui/card"; import { Button } from "./ui/button"; import { Badge } from "./ui/badge"; import { ChevronRight, RotateCcw, Wand2 } from "lucide-react"; -import { navigateTo } from './Router'; +import { navigate } from './Router'; const wizardSteps = [ { @@ -103,7 +103,7 @@ export function ProgrammeWizard() { navigateTo(`/programme/${recommendation.slug}`)} + onClick={() => navigate(`/programme/${recommendation.slug}`)} > View Programme Details diff --git a/src/components/Router.tsx b/src/components/Router.tsx index 5b83f46..9cd5f96 100644 --- a/src/components/Router.tsx +++ b/src/components/Router.tsx @@ -1,306 +1,219 @@ -import React from 'react'; +import { Routes, Route, Navigate, useSearchParams } from "react-router-dom"; // Import all page components -import { HomePage } from '../pages/HomePage'; -import Dashboard from '../pages/learner/Dashboard'; -import { CorporateDashboard } from '../pages/learner/CorporateDashboard'; -import { Library } from '../pages/learner/Library'; -import { CourseTimeline } from '../pages/learner/CourseTimeline'; -import { Settings } from '../pages/Settings'; -import { Surveys } from '../pages/Surveys'; -import { CorporateWebinars } from '../pages/CorporateWebinars'; -import { IndividualWebinars } from '../pages/IndividualWebinars'; -import { Leaderboard } from '../pages/Leaderboard'; -import { CorporateLeaderboard } from '../pages/CorporateLeaderboard'; -import { LoginSelection } from '../pages/LoginSelection'; -import { Login } from '../pages/Login'; -import { Signup } from '../pages/Signup'; -import { CorporateAuth } from '../pages/CorporateAuth'; -import { CorporateLogin } from '../pages/CorporateLogin'; -import { CorporateSignup } from '../pages/CorporateSignup'; -import { ForgotPassword } from '../pages/ForgotPassword'; -import { EmailVerification } from '../pages/EmailVerification'; -import { Contact } from '../pages/Contact'; -import { AboutKLC } from '../pages/AboutKLC'; -import { OurVision } from '../pages/OurVision'; -import { OurTeam } from '../pages/OurTeam'; -import { OurImpact } from '../pages/OurImpact'; -import { OurExpertise } from '../pages/OurExpertise'; -import { ProgrammeCatalogue } from '../pages/ProgrammeCatalogue'; -import { ProgrammeDetail } from '../pages/ProgrammeDetail'; -import { ExecutiveLeadership } from '../pages/ExecutiveLeadership'; -import { TeamLeadership } from '../pages/TeamLeadership'; -import { InnovationLeadership } from '../pages/InnovationLeadership'; -import { LeadershipOnline } from '../pages/LeadershipOnline'; -import { LeadershipDevelopment } from '../pages/services/LeadershipDevelopment'; -import { ManagementDevelopment } from '../pages/services/ManagementDevelopment'; -import { ExecutiveCoaching } from '../pages/services/ExecutiveCoaching'; -import { CultureCompetence } from '../pages/services/CultureCompetence'; -import { Consulting } from '../pages/services/Consulting'; -import { LearningFacility } from '../pages/services/LearningFacility'; -import { Articles } from '../pages/Articles'; -import { BlogListing } from '../pages/BlogListing'; -import { BlogDetail } from '../pages/BlogDetail'; -import { Resources } from '../pages/Resources'; -import { WebinarListing } from '../pages/WebinarListing'; -import { WebinarDetail } from '../pages/WebinarDetail'; -import { FacilityDetail } from '../pages/FacilityDetail'; -import { FacilityBooking } from '../pages/FacilityBooking'; -import { FacilityTour } from '../pages/FacilityTour'; -import { Cart } from '../pages/Cart'; -import { Checkout } from '../pages/Checkout'; -import { OrderConfirmation } from '../pages/OrderConfirmation'; -import { OrderFailed } from '../pages/OrderFailed'; -import { MyCohort } from '../pages/MyCohort'; -import { FAQ } from '../pages/FAQ'; -import { Privacy } from '../pages/Privacy'; -import { Terms } from '../pages/Terms'; -import { NotFound } from '../pages/NotFound'; +import { HomePage } from "../pages/HomePage"; +import Dashboard from "../pages/learner/Dashboard"; +import { CorporateDashboard } from "../pages/learner/CorporateDashboard"; +import { Library } from "../pages/learner/Library"; +import { CourseTimeline } from "../pages/learner/CourseTimeline"; +import { Settings } from "../pages/Settings"; +import { Surveys } from "../pages/Surveys"; +import { CorporateWebinars } from "../pages/CorporateWebinars"; +import { IndividualWebinars } from "../pages/IndividualWebinars"; +import { Leaderboard } from "../pages/Leaderboard"; +import { CorporateLeaderboard } from "../pages/CorporateLeaderboard"; +import { LoginSelection } from "../pages/LoginSelection"; +import { Login } from "../pages/Login"; +import { Signup } from "../pages/Signup"; +import { CorporateAuth } from "../pages/CorporateAuth"; +import { CorporateLogin } from "../pages/CorporateLogin"; +import { CorporateSignup } from "../pages/CorporateSignup"; +import { ForgotPassword } from "../pages/ForgotPassword"; +import { EmailVerification } from "../pages/EmailVerification"; +import { Contact } from "../pages/Contact"; +import { AboutKLC } from "../pages/AboutKLC"; +import { OurVision } from "../pages/OurVision"; +import { OurTeam } from "../pages/OurTeam"; +import { OurImpact } from "../pages/OurImpact"; +import { OurExpertise } from "../pages/OurExpertise"; +import { ProgrammeCatalogue } from "../pages/ProgrammeCatalogue"; +import { ProgrammeDetail } from "../pages/ProgrammeDetail"; +import { ExecutiveLeadership } from "../pages/ExecutiveLeadership"; +import { TeamLeadership } from "../pages/TeamLeadership"; +import { InnovationLeadership } from "../pages/InnovationLeadership"; +import { LeadershipOnline } from "../pages/LeadershipOnline"; +import { LeadershipDevelopment } from "../pages/services/LeadershipDevelopment"; +import { ManagementDevelopment } from "../pages/services/ManagementDevelopment"; +import { ExecutiveCoaching } from "../pages/services/ExecutiveCoaching"; +import { CultureCompetence } from "../pages/services/CultureCompetence"; +import { Consulting } from "../pages/services/Consulting"; +import { LearningFacility } from "../pages/services/LearningFacility"; +import { Articles } from "../pages/Articles"; +import { BlogListing } from "../pages/BlogListing"; +import { BlogDetail } from "../pages/BlogDetail"; +import { Resources } from "../pages/Resources"; +import { WebinarListing } from "../pages/WebinarListing"; +import { WebinarDetail } from "../pages/WebinarDetail"; +import { FacilityDetail } from "../pages/FacilityDetail"; +import { FacilityBooking } from "../pages/FacilityBooking"; +import { FacilityTour } from "../pages/FacilityTour"; +import { Cart } from "../pages/Cart"; +import { Checkout } from "../pages/Checkout"; +import { OrderConfirmation } from "../pages/OrderConfirmation"; +import { OrderFailed } from "../pages/OrderFailed"; +import { MyCohort } from "../pages/MyCohort"; +import { FAQ } from "../pages/FAQ"; +import { Privacy } from "../pages/Privacy"; +import { Terms } from "../pages/Terms"; +import { NotFound } from "../pages/NotFound"; -// Router function to navigate programmatically -export function navigateTo(path: string) { - window.history.pushState({}, '', path); - window.dispatchEvent(new PopStateEvent('popstate')); +function DashboardRoute() { + const [searchParams] = useSearchParams(); + const view = searchParams.get("view"); + return view === "corporate" ? ( + + ) : ( + + ); } -// Get query parameter helper -function getQueryParam(param: string): string | null { - const urlParams = new URLSearchParams(window.location.search); - return urlParams.get(param); +function WebinarsRoute() { + const [searchParams] = useSearchParams(); + const view = searchParams.get("view"); + return view === "corporate" ? : ; +} + +function LeaderboardRoute() { + const [searchParams] = useSearchParams(); + const view = searchParams.get("view"); + return view === "corporate" ? : ; } -// Router component export function Router() { - const [currentPath, setCurrentPath] = React.useState(window.location.pathname); - - React.useEffect(() => { - const handlePopState = () => { - setCurrentPath(window.location.pathname); - }; - - window.addEventListener('popstate', handlePopState); - return () => window.removeEventListener('popstate', handlePopState); - }, []); - - // Handle legacy route redirects - React.useEffect(() => { - // Redirect old corporate routes to new query parameter format - const legacyRedirects: Record = { - '/corporate/dashboard': '/dashboard?view=corporate', - '/corporate/library': '/library?view=corporate', - '/corporate/course': '/course?view=corporate', - '/corporate/settings': '/settings?view=corporate', - '/corporate/surveys': '/surveys?view=corporate', - '/corporate/webinars': '/webinars?view=corporate', - '/corporate/leaderboard': '/leaderboard?view=corporate' - }; - - if (legacyRedirects[currentPath]) { - navigateTo(legacyRedirects[currentPath]); - return; - } - - // Redirect deprecated service pages to home - const deprecatedServiceRoutes = [ - '/services', - '/services/leadership-development', - '/services/management-development', - '/services/executive-coaching', - '/services/culture-competence', - '/services/consulting', - '/services/learning-facility' - ]; - - if (deprecatedServiceRoutes.includes(currentPath)) { - navigateTo('/'); - return; - } - - // Redirect deprecated about pages to home - const deprecatedAboutRoutes = [ - '/about-us/our-vision', - '/about-us/our-team', - '/about-us/our-impact', - '/about-us/our-expertise' - ]; - - if (deprecatedAboutRoutes.includes(currentPath)) { - navigateTo('/'); - return; - } - - // Redirect deprecated learning pages to home - const deprecatedLearningRoutes = [ - '/learning/articles', - '/learning/blog', - '/learning/resources' - ]; - - if (deprecatedLearningRoutes.includes(currentPath)) { - navigateTo('/'); - return; - } - }, [currentPath]); - - // Route matching logic - const renderRoute = () => { - const path = currentPath; - const viewParam = getQueryParam('view'); - - switch (path) { - case '/': - return ; - - // Authentication routes - case '/auth': - case '/login-selection': - return ; - case '/login': - return ; - case '/signup': - return ; - case '/corporate/auth': - return ; - case '/corporate/login': - return ; - case '/corporate/signup': - return ; - case '/forgot-password': - return ; - case '/email-verification': - return ; - - // Learner portal routes with query parameter support - case '/dashboard': - // Route to appropriate dashboard based on view parameter - if (viewParam === 'corporate') { - return ; - } - return ; - case '/library': - return ; - case '/course': - return ; - case '/settings': - return ; - case '/surveys': - return ; - case '/webinars': - // Route to appropriate webinar page based on view parameter - if (viewParam === 'corporate') { - return ; - } - return ; - case '/leaderboard': - // Route to appropriate leaderboard based on view parameter - if (viewParam === 'corporate') { - return ; - } - return ; - - // Individual webinars (accessible without authentication) - case '/individual-webinars': - return ; - - // Contact and support - case '/contact': - return ; - - // About pages (deprecated - redirect to home) - case '/about-klc': - return ; - case '/about-us/our-vision': - return ; - case '/about-us/our-team': - return ; - case '/about-us/our-impact': - return ; - case '/about-us/our-expertise': - return ; - - // Programme pages (deprecated - redirect to home) - case '/programmes': - return ; - case '/programmes/detail': - return ; - case '/programmes/executive-leadership': - return ; - case '/programmes/team-leadership': - return ; - case '/programmes/innovation-leadership': - return ; - case '/programmes/leadership-online': - return ; - - // Service pages (deprecated - redirect to home) - case '/services/leadership-development': - return ; - case '/services/management-development': - return ; - case '/services/executive-coaching': - return ; - case '/services/culture-competence': - return ; - case '/services/consulting': - return ; - case '/services/learning-facility': - return ; - - // Learning pages (deprecated - redirect to home) - case '/learning/articles': - return ; - case '/learning/blog': - return ; - case '/learning/blog/detail': - return ; - case '/learning/resources': - return ; - - // Webinar pages (deprecated - redirect to home) - case '/webinars/listing': - return ; - case '/webinars/detail': - return ; - - // Facility pages (deprecated - redirect to home) - case '/facilities/detail': - return ; - case '/facilities/booking': - return ; - case '/facilities/tour': - return ; - - // E-commerce pages (deprecated - redirect to home) - case '/cart': - return ; - case '/checkout': - return ; - case '/order-confirmation': - return ; - case '/order-failed': - return ; - - // Additional learner features (deprecated - redirect to home) - case '/my-cohort': - return ; - - // Legal and support pages - case '/faq': - return ; - case '/privacy': - return ; - case '/terms': - return ; - - // 404 page - default: - return ; - } - }; - return ( - {renderRoute()} + + {/* Main */} + } /> + + {/* Auth */} + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + + {/* Learner Portal */} + } /> + } /> + } /> + } /> + } /> + } /> + } /> + + {/* Other Pages */} + } /> + } /> + } /> + } /> + } /> + } /> + } /> + + {/* Programmes */} + } /> + } /> + } + /> + } /> + } + /> + } + /> + + {/* Services */} + } + /> + } + /> + } + /> + } + /> + } /> + } /> + + {/* Learning */} + } /> + } /> + } /> + } /> + + {/* Webinars */} + } /> + } /> + + {/* Facilities */} + } /> + } /> + } /> + + {/* E-commerce */} + } /> + } /> + } /> + } /> + + {/* Extra Features */} + } /> + + {/* Legal */} + } /> + } /> + } /> + + {/* Legacy Redirects */} + } + /> + } + /> + } + /> + } + /> + } + /> + } + /> + } + /> + + {/* Catch-all */} + } /> + ); -} \ No newline at end of file +} diff --git a/src/components/learner/CourseCard.tsx b/src/components/learner/CourseCard.tsx index 072e206..35ae2de 100644 --- a/src/components/learner/CourseCard.tsx +++ b/src/components/learner/CourseCard.tsx @@ -22,7 +22,7 @@ import { AlertCircle } from 'lucide-react'; import { Course } from '../../pages/learner/data/libraryData'; -import { navigateTo } from '../Router'; + const navigate = useNavigate(); interface CourseCardProps { course: Course; @@ -66,7 +66,7 @@ export function CourseCard({ course, userType, onEnroll, onContinue, onBookmark // Navigate to course details page with proper query parameters const handleCourseNavigation = () => { - navigateTo(`/course?view=${userType}&courseId=${course.id}`); + navigate(`/course?view=${userType}&courseId=${course.id}`); }; return ( diff --git a/src/components/learner/CourseListItem.tsx b/src/components/learner/CourseListItem.tsx index 98e29aa..8a0d0b6 100644 --- a/src/components/learner/CourseListItem.tsx +++ b/src/components/learner/CourseListItem.tsx @@ -17,7 +17,7 @@ import { Target } from 'lucide-react'; import { Course } from '../../pages/learner/data/libraryData'; -import { navigateTo } from '../Router'; + const navigate = useNavigate(); interface CourseListItemProps { course: Course; @@ -66,7 +66,7 @@ export function CourseListItem({ course, userType, onEnroll, onContinue, onBookm // Navigate to course details page with proper query parameters const handleCourseNavigation = () => { - navigateTo(`/course?view=${userType}&courseId=${course.id}`); + navigate(`/course?view=${userType}&courseId=${course.id}`); }; return ( diff --git a/src/components/learner/HorizontalCourseCard.tsx b/src/components/learner/HorizontalCourseCard.tsx index 6c951cc..7142bcc 100644 --- a/src/components/learner/HorizontalCourseCard.tsx +++ b/src/components/learner/HorizontalCourseCard.tsx @@ -14,8 +14,8 @@ import { MoreHorizontal } from 'lucide-react'; import { Course } from '../../pages/learner/data/libraryData'; -import { navigateTo } from '../Router'; import { ImageWithFallback } from '../figma/ImageWithFallback'; +import { useNavigate } from 'react-router-dom'; interface HorizontalCourseCardProps { course: Course; @@ -90,10 +90,12 @@ const getCourseImage = (category: string) => { export function HorizontalCourseCard({ course, userType, onEnroll, onContinue, onBookmark }: HorizontalCourseCardProps) { const courseImage = getCourseImage(course.category); + const navigate = useNavigate(); + // Navigate to course details page with proper query parameters const handleCourseNavigation = () => { - navigateTo(`/course?view=${userType}&courseId=${course.id}`); + navigate(`/course?view=${userType}&courseId=${course.id}`); }; return ( diff --git a/src/components/learner/LearnerLayout.tsx b/src/components/learner/LearnerLayout.tsx index 3b6822b..d22253b 100644 --- a/src/components/learner/LearnerLayout.tsx +++ b/src/components/learner/LearnerLayout.tsx @@ -5,6 +5,7 @@ import { Badge } from '../ui/badge'; import { Sheet, SheetContent, SheetTrigger } from '../ui/sheet'; import { ScrollArea } from '../ui/scroll-area'; import { Separator } from '../ui/separator'; +import logo from "../../assets/klc-logo.png" import { Menu, Search, @@ -22,7 +23,7 @@ import { X, Settings } from 'lucide-react'; -import { navigateTo } from '../Router'; +import { useNavigate } from 'react-router-dom'; interface LearnerLayoutProps { children: React.ReactNode; @@ -54,6 +55,7 @@ interface NotificationPanelProps { function NotificationPanel({ isOpen, onClose, notifications }: NotificationPanelProps) { const unreadCount = notifications.filter(n => !n.read).length; + const navigate = useNavigate(); if (!isOpen) return null; @@ -88,9 +90,9 @@ function NotificationPanel({ isOpen, onClose, notifications }: NotificationPanel > {notification.title} @@ -110,7 +112,7 @@ function NotificationPanel({ isOpen, onClose, notifications }: NotificationPanel variant="outline" size="sm" className="w-full text-lg min-h-[44px]" - onClick={() => navigateTo('/notifications')} + onClick={() => navigate('/notifications')} > View All Notifications @@ -129,6 +131,8 @@ export function LearnerLayout({ children, currentPage, userType = 'individual', const [sidebarOpen, setSidebarOpen] = useState(false); const [notificationsOpen, setNotificationsOpen] = useState(false); const [searchValue, setSearchValue] = useState(''); + const navigate = useNavigate(); + // Get current view parameter directly from URL const getCurrentView = () => { @@ -243,12 +247,17 @@ export function LearnerLayout({ children, currentPage, userType = 'individual', {/* Logo */} - + {/* KLC Learning Portal - + */} + {/* Navigation */} @@ -261,11 +270,11 @@ export function LearnerLayout({ children, currentPage, userType = 'individual', key={item.name} variant={item.active ? "secondary" : "ghost"} className={`w-full justify-start text-lg h-10 min-h-[44px] ${item.active - ? 'bg-brand-gold text-brand-gold-foreground hover:bg-brand-gold/90' - : 'text-white/80 hover:bg-white/10 hover:text-white' + ? 'bg-brand-gold text-brand-gold-foreground hover:bg-brand-gold/90' + : 'text-white/80 hover:bg-white/10 hover:text-white' }`} onClick={() => { - navigateTo(item.href); + navigate(item.href); setSidebarOpen(false); }} > diff --git a/src/components/learner/UpcomingEvents.tsx b/src/components/learner/UpcomingEvents.tsx index fcffb78..7dd2dc8 100644 --- a/src/components/learner/UpcomingEvents.tsx +++ b/src/components/learner/UpcomingEvents.tsx @@ -14,7 +14,7 @@ import { Globe, ExternalLink } from 'lucide-react'; -import { navigateTo } from '../Router'; +import { useNavigate } from 'react-router-dom'; interface UpcomingEventsProps { userType: 'individual' | 'corporate'; @@ -37,6 +37,8 @@ interface Event { export function UpcomingEvents({ userType }: UpcomingEventsProps) { const [currentMonth, setCurrentMonth] = useState(new Date()); + const navigate = useNavigate(); + // Sample events data const events: Event[] = [ @@ -262,7 +264,7 @@ export function UpcomingEvents({ userType }: UpcomingEventsProps) { navigateTo(`/webinars?view=${userType}`)} + onClick={() => navigate(`/webinars?view=${userType}`)} className="text-[14px] text-[#6B7280] hover:text-[#111827] hover:bg-gray-100 rounded-md h-8 px-2" > View All @@ -364,7 +366,7 @@ export function UpcomingEvents({ userType }: UpcomingEventsProps) { size="sm" variant={event.status === 'live' ? 'destructive' : event.status === 'today' ? 'default' : 'outline'} className="text-[12px] font-semibold min-h-[28px] px-3 rounded-md" - onClick={() => navigateTo(`/webinars?view=${userType}`)} + onClick={() => navigate(`/webinars?view=${userType}`)} > {event.status === 'live' ? 'Join Now' : 'View Details'} @@ -387,7 +389,7 @@ export function UpcomingEvents({ userType }: UpcomingEventsProps) { navigateTo(`/webinars?view=${userType}`)} + onClick={() => navigate(`/webinars?view=${userType}`)} > Browse All Webinars @@ -395,7 +397,7 @@ export function UpcomingEvents({ userType }: UpcomingEventsProps) { navigateTo(`/surveys?view=${userType}`)} + onClick={() => navigate(`/surveys?view=${userType}`)} > Schedule Assessment @@ -404,7 +406,7 @@ export function UpcomingEvents({ userType }: UpcomingEventsProps) { navigateTo(`/dashboard?view=${userType}`)} + onClick={() => navigate(`/dashboard?view=${userType}`)} > Team Calendar diff --git a/src/pages/AboutKLC.tsx b/src/pages/AboutKLC.tsx index 5cf0bee..2677533 100644 --- a/src/pages/AboutKLC.tsx +++ b/src/pages/AboutKLC.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function AboutKLC() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Articles.tsx b/src/pages/Articles.tsx index f9f375b..1ba2a43 100644 --- a/src/pages/Articles.tsx +++ b/src/pages/Articles.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Articles() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/BlogDetail.tsx b/src/pages/BlogDetail.tsx index e86b33e..28f3ac8 100644 --- a/src/pages/BlogDetail.tsx +++ b/src/pages/BlogDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function BlogDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/BlogListing.tsx b/src/pages/BlogListing.tsx index 7a7dfd0..758e4e1 100644 --- a/src/pages/BlogListing.tsx +++ b/src/pages/BlogListing.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function BlogListing() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Cart.tsx b/src/pages/Cart.tsx index 34b0058..21883b6 100644 --- a/src/pages/Cart.tsx +++ b/src/pages/Cart.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Cart() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Checkout.tsx b/src/pages/Checkout.tsx index e66b297..f5fa426 100644 --- a/src/pages/Checkout.tsx +++ b/src/pages/Checkout.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Checkout() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Contact.tsx b/src/pages/Contact.tsx index b1b46a5..2a46220 100644 --- a/src/pages/Contact.tsx +++ b/src/pages/Contact.tsx @@ -3,7 +3,7 @@ import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Mail, Phone, MapPin, Clock, Send } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Contact() { const [formData, setFormData] = useState({ @@ -31,7 +31,7 @@ export function Contact() { }; const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( diff --git a/src/pages/CorporateAuth.tsx b/src/pages/CorporateAuth.tsx index 8d6b99d..18e359c 100644 --- a/src/pages/CorporateAuth.tsx +++ b/src/pages/CorporateAuth.tsx @@ -2,19 +2,19 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Building2, Users, Shield, BarChart3 } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function CorporateAuth() { const handleBackNavigation = () => { - navigateTo('/auth'); + navigate('/auth'); }; const handleLogin = () => { - navigateTo('/corporate/login'); + navigate('/corporate/login'); }; const handleSignup = () => { - navigateTo('/corporate/signup'); + navigate('/corporate/signup'); }; return ( @@ -141,7 +141,7 @@ export function CorporateAuth() { navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[14px] border-purple-600 text-purple-600 hover:bg-purple-100" > Contact Support diff --git a/src/pages/CorporateLeaderboard.tsx b/src/pages/CorporateLeaderboard.tsx index bb910dd..c0f526b 100644 --- a/src/pages/CorporateLeaderboard.tsx +++ b/src/pages/CorporateLeaderboard.tsx @@ -39,7 +39,7 @@ import { Flag, Sparkles } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); // Mock data for leaderboard const mockLeaderboard = [ diff --git a/src/pages/CorporateLearnerLogin.tsx b/src/pages/CorporateLearnerLogin.tsx index 0ef6510..f748ccc 100644 --- a/src/pages/CorporateLearnerLogin.tsx +++ b/src/pages/CorporateLearnerLogin.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'; import { Navigation } from '../components/Navigation'; import { Footer } from '../components/Footer'; import { AIChatbot } from '../components/AIChatbot'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); import { Button } from '../components/ui/button'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '../components/ui/card'; import { Input } from '../components/ui/input'; @@ -324,11 +324,11 @@ export default function CorporateLearnerLogin() { if (signInData.workEmail === 'learner@company.com' && signInData.password === 'learner123') { const redirectUrl = sessionStorage.getItem('loginRedirect') || '/corporate/dashboard'; sessionStorage.removeItem('loginRedirect'); - navigateTo(redirectUrl); + navigate(redirectUrl); } else if (requiresMFA && signInData.otp === '123456') { const redirectUrl = sessionStorage.getItem('loginRedirect') || '/corporate/dashboard'; sessionStorage.removeItem('loginRedirect'); - navigateTo(redirectUrl); + navigate(redirectUrl); } else { setErrors({ submit: 'Email or password incorrect' }); triggerFormShake(); @@ -365,7 +365,7 @@ export default function CorporateLearnerLogin() { }; const handleVerifyEmail = (token: string) => { - navigateTo('/corporate/dashboard'); + navigate('/corporate/dashboard'); }; if (showEmailVerification) { diff --git a/src/pages/CorporateLogin.tsx b/src/pages/CorporateLogin.tsx index a4c632d..8990af6 100644 --- a/src/pages/CorporateLogin.tsx +++ b/src/pages/CorporateLogin.tsx @@ -3,7 +3,7 @@ import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Eye, EyeOff, Mail, Lock, Building2 } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); import { useAuth } from '../components/AuthContext'; export function CorporateLogin() { @@ -20,11 +20,11 @@ export function CorporateLogin() { try { // Simulate corporate login and go directly to corporate dashboard await login(email || 'corporate@klc.edu', password || 'demo'); - navigateTo('/dashboard?view=corporate'); + navigate('/dashboard?view=corporate'); } catch (error) { console.error('Corporate login failed:', error); // Even if login fails, still navigate to dashboard for ease of use - navigateTo('/dashboard?view=corporate'); + navigate('/dashboard?view=corporate'); } finally { setIsLoading(false); } @@ -34,16 +34,16 @@ export function CorporateLogin() { // Direct navigation to corporate dashboard without form validation setIsLoading(true); login('corporate@klc.edu', 'demo').then(() => { - navigateTo('/dashboard?view=corporate'); + navigate('/dashboard?view=corporate'); }).catch(() => { - navigateTo('/dashboard?view=corporate'); + navigate('/dashboard?view=corporate'); }).finally(() => { setIsLoading(false); }); }; const handleBackNavigation = () => { - navigateTo('/corporate/auth'); + navigate('/corporate/auth'); }; return ( @@ -169,7 +169,7 @@ export function CorporateLogin() { navigateTo('/forgot-password')} + onClick={() => navigate('/forgot-password')} className="text-[16px] text-primary hover:text-primary/80 font-medium" > Forgot password? @@ -189,7 +189,7 @@ export function CorporateLogin() { Need corporate access?{' '} navigateTo('/corporate/signup')} + onClick={() => navigate('/corporate/signup')} className="text-primary hover:text-primary/80 font-medium" > Contact your administrator diff --git a/src/pages/CorporateSignup.tsx b/src/pages/CorporateSignup.tsx index c3dd523..cbcef38 100644 --- a/src/pages/CorporateSignup.tsx +++ b/src/pages/CorporateSignup.tsx @@ -3,7 +3,7 @@ import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Mail, User, Building2, Phone, Users } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function CorporateSignup() { const [formData, setFormData] = useState({ @@ -25,7 +25,7 @@ export function CorporateSignup() { try { // Simulate request submission await new Promise(resolve => setTimeout(resolve, 1000)); - navigateTo('/email-verification'); + navigate('/email-verification'); } catch (error) { console.error('Request failed:', error); } finally { @@ -34,7 +34,7 @@ export function CorporateSignup() { }; const handleBackNavigation = () => { - navigateTo('/corporate/auth'); + navigate('/corporate/auth'); }; return ( diff --git a/src/pages/CorporateWebinars.tsx b/src/pages/CorporateWebinars.tsx index 918b309..4ca879a 100644 --- a/src/pages/CorporateWebinars.tsx +++ b/src/pages/CorporateWebinars.tsx @@ -47,9 +47,10 @@ import { MoreHorizontal, Search } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +// const navigate = useNavigate(); import { ImageWithFallback } from '../components/figma/ImageWithFallback'; - +import { useNavigate } from 'react-router-dom'; + const navigate = useNavigate(); // Mock data for webinars const mockWebinars = [ { @@ -266,7 +267,7 @@ function WebinarCard({ webinar }: { webinar: typeof mockWebinars[0] }) { const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false); const handleJoinWebinar = () => { - navigateTo(`/webinar-detail?id=${webinar.id}&view=corporate`); + navigate(`/webinar-detail?id=${webinar.id}&view=corporate`); }; const toggleDescription = (e: React.MouseEvent) => { @@ -637,7 +638,7 @@ export function CorporateWebinars() { navigateTo(`/webinar-detail?id=${webinar.id}&view=corporate`)} + onClick={() => navigate(`/webinar-detail?id=${webinar.id}&view=corporate`)} > @@ -670,7 +671,7 @@ export function CorporateWebinars() { navigateTo('/webinars?view=corporate')} + onClick={() => navigate('/webinars?view=corporate')} className="w-full text-base h-11" > View All Webinars diff --git a/src/pages/EmailVerification.tsx b/src/pages/EmailVerification.tsx index 8f8db8a..17c7c8a 100644 --- a/src/pages/EmailVerification.tsx +++ b/src/pages/EmailVerification.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { Mail, CheckCircle, RefreshCw } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function EmailVerification() { const handleResendEmail = () => { @@ -55,7 +55,7 @@ export function EmailVerification() { navigateTo('/auth')} + onClick={() => navigate('/auth')} className="w-full text-[16px] min-h-[44px] bg-primary hover:bg-primary/90" > Back to Sign In @@ -66,7 +66,7 @@ export function EmailVerification() { Need help? Contact our{' '} navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-primary hover:text-primary/80 font-medium" > support team diff --git a/src/pages/ExecutiveLeadership.tsx b/src/pages/ExecutiveLeadership.tsx index 107b8ff..e172cd2 100644 --- a/src/pages/ExecutiveLeadership.tsx +++ b/src/pages/ExecutiveLeadership.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ExecutiveLeadership() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/FAQ.tsx b/src/pages/FAQ.tsx index b22e5e4..a9a90f3 100644 --- a/src/pages/FAQ.tsx +++ b/src/pages/FAQ.tsx @@ -3,11 +3,11 @@ import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../components/ui/collapsible'; import { ArrowLeft, ChevronDown, HelpCircle, Mail, Phone } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function FAQ() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; const faqData = [ @@ -129,7 +129,7 @@ export function FAQ() { navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[16px] min-h-[44px] bg-primary hover:bg-primary/90" > diff --git a/src/pages/FacilityBooking.tsx b/src/pages/FacilityBooking.tsx index b4770b8..72d4065 100644 --- a/src/pages/FacilityBooking.tsx +++ b/src/pages/FacilityBooking.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function FacilityBooking() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/FacilityDetail.tsx b/src/pages/FacilityDetail.tsx index 646e3fe..e3358a6 100644 --- a/src/pages/FacilityDetail.tsx +++ b/src/pages/FacilityDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function FacilityDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/FacilityTour.tsx b/src/pages/FacilityTour.tsx index db9adad..909d747 100644 --- a/src/pages/FacilityTour.tsx +++ b/src/pages/FacilityTour.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function FacilityTour() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/ForgotPassword.tsx b/src/pages/ForgotPassword.tsx index 7775b58..0a4311c 100644 --- a/src/pages/ForgotPassword.tsx +++ b/src/pages/ForgotPassword.tsx @@ -3,7 +3,7 @@ import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Mail, CheckCircle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ForgotPassword() { const [email, setEmail] = useState(''); @@ -26,7 +26,7 @@ export function ForgotPassword() { }; const handleBackNavigation = () => { - navigateTo('/auth'); + navigate('/auth'); }; if (isSubmitted) { @@ -52,7 +52,7 @@ export function ForgotPassword() { navigateTo('/auth')} + onClick={() => navigate('/auth')} className="w-full text-[16px] min-h-[48px] bg-primary hover:bg-primary/90" > Back to Sign In @@ -137,7 +137,7 @@ export function ForgotPassword() { Remember your password?{' '} navigateTo('/auth')} + onClick={() => navigate('/auth')} className="text-primary hover:text-primary/80 font-medium" > Back to Sign In diff --git a/src/pages/IndividualWebinars.tsx b/src/pages/IndividualWebinars.tsx index 1d433ab..f5f4abc 100644 --- a/src/pages/IndividualWebinars.tsx +++ b/src/pages/IndividualWebinars.tsx @@ -60,7 +60,7 @@ import { Tag, AlertTriangle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +import { useNavigate } from 'react-router-dom'; // Types interface Webinar { @@ -849,6 +849,8 @@ export function IndividualWebinars() { const [filterCategory, setFilterCategory] = useState('all'); const [filterDifficulty, setFilterDifficulty] = useState('all'); const [sortBy, setSortBy] = useState('date'); + const navigate = useNavigate(); + // Mock user data for LearnerLayout - matching Library page pattern const user = { diff --git a/src/pages/InnovationLeadership.tsx b/src/pages/InnovationLeadership.tsx index c8b4b70..433519f 100644 --- a/src/pages/InnovationLeadership.tsx +++ b/src/pages/InnovationLeadership.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function InnovationLeadership() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Leaderboard.tsx b/src/pages/Leaderboard.tsx index e09c2b5..922d119 100644 --- a/src/pages/Leaderboard.tsx +++ b/src/pages/Leaderboard.tsx @@ -37,7 +37,7 @@ import { Shield, Gem } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +import { useNavigate } from 'react-router-dom'; // Types interface LeaderboardEntry { @@ -652,6 +652,8 @@ export function Leaderboard() { const [activeTab, setActiveTab] = useState('global'); const [filterPeriod, setFilterPeriod] = useState('all-time'); const [filterCategory, setFilterCategory] = useState('all'); + const navigate = useNavigate(); + // Mock user data for LearnerLayout - matching Library page pattern const user = { diff --git a/src/pages/LeadershipOnline.tsx b/src/pages/LeadershipOnline.tsx index a3cdb88..54a69eb 100644 --- a/src/pages/LeadershipOnline.tsx +++ b/src/pages/LeadershipOnline.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function LeadershipOnline() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Login.tsx b/src/pages/Login.tsx index 478733b..3c0fe93 100644 --- a/src/pages/Login.tsx +++ b/src/pages/Login.tsx @@ -3,8 +3,9 @@ import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Eye, EyeOff, Mail, Lock } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); import { useAuth } from '../components/AuthContext'; +import { useNavigate } from 'react-router-dom'; export function Login() { const [email, setEmail] = useState(''); @@ -20,11 +21,11 @@ export function Login() { try { // Simulate login and go directly to individual dashboard await login(email || 'demo@klc.edu', password || 'demo'); - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); } catch (error) { console.error('Login failed:', error); // Even if login fails, still navigate to dashboard for ease of use - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); } finally { setIsLoading(false); } @@ -34,16 +35,16 @@ export function Login() { // Direct navigation to individual dashboard without form validation setIsLoading(true); login('demo@klc.edu', 'demo').then(() => { - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); }).catch(() => { - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); }).finally(() => { setIsLoading(false); }); }; const handleBackNavigation = () => { - navigateTo('/auth'); + navigate('/auth'); }; return ( @@ -166,7 +167,7 @@ export function Login() { navigateTo('/forgot-password')} + onClick={() => navigate('/forgot-password')} className="text-[16px] text-primary hover:text-primary/80 font-medium" > Forgot password? @@ -186,7 +187,7 @@ export function Login() { Don't have an account?{' '} navigateTo('/signup')} + onClick={() => navigate('/signup')} className="text-primary hover:text-primary/80 font-medium" > Create one here diff --git a/src/pages/LoginSelection.tsx b/src/pages/LoginSelection.tsx index 802bccb..2f85860 100644 --- a/src/pages/LoginSelection.tsx +++ b/src/pages/LoginSelection.tsx @@ -3,31 +3,32 @@ import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { Badge } from '../components/ui/badge'; import { ArrowLeft, Building2, User, ArrowRight, CheckCircle, Users, Target, BookOpen, Video, Award, BarChart3 } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +// const navigate = useNavigate(); import { useAuth } from '../components/AuthContext'; - +import { useNavigate } from 'react-router-dom'; + const navigate = useNavigate(); export function LoginSelection() { const { login } = useAuth(); const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; const handleIndividualLogin = () => { // Direct navigation to individual dashboard login('demo@klc.edu', 'demo').then(() => { - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); }).catch(() => { - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); }); }; const handleCorporateLogin = () => { // Direct navigation to corporate dashboard login('corporate@klc.edu', 'demo').then(() => { - navigateTo('/dashboard?view=corporate'); + navigate('/dashboard?view=corporate'); }).catch(() => { - navigateTo('/dashboard?view=corporate'); + navigate('/dashboard?view=corporate'); }); }; @@ -145,7 +146,7 @@ export function LoginSelection() { Want to explore first?{' '} navigateTo('/login')} + onClick={() => navigate('/login')} className="text-blue-600 hover:text-blue-700 font-medium hover:underline" > View login options @@ -237,7 +238,7 @@ export function LoginSelection() { Want to explore first?{' '} navigateTo('/corporate/login')} + onClick={() => navigate('/corporate/login')} className="text-purple-600 hover:text-purple-700 font-medium hover:underline" > View login options @@ -285,14 +286,14 @@ export function LoginSelection() { navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[16px] min-h-[44px] border-[#04045B] text-[#04045B] hover:bg-[#04045B]/10" > Contact Support navigateTo('/individual-webinars')} + onClick={() => navigate('/individual-webinars')} className="text-[16px] min-h-[44px] border-[#04045B] text-[#04045B] hover:bg-[#04045B]/10" > Explore Learning Resources diff --git a/src/pages/MyCohort.tsx b/src/pages/MyCohort.tsx index cf0eb25..0613ebc 100644 --- a/src/pages/MyCohort.tsx +++ b/src/pages/MyCohort.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function MyCohort() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/NotFound.tsx b/src/pages/NotFound.tsx index 32f2c61..4964d76 100644 --- a/src/pages/NotFound.tsx +++ b/src/pages/NotFound.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent } from '../components/ui/card'; import { ArrowLeft, Home, Search, HelpCircle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function NotFound() { const handleGoHome = () => { - navigateTo('/'); + navigate('/'); }; const handleGoBack = () => { @@ -56,7 +56,7 @@ export function NotFound() { navigateTo('/individual-webinars')} + onClick={() => navigate('/individual-webinars')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -64,7 +64,7 @@ export function NotFound() { navigateTo('/contact')} + onClick={() => navigate('/contact')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -72,7 +72,7 @@ export function NotFound() { navigateTo('/auth')} + onClick={() => navigate('/auth')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -86,7 +86,7 @@ export function NotFound() { Still need help? Contact our{' '} navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[#04045B] hover:text-[#04045B]/80 font-medium" > support team diff --git a/src/pages/OrderConfirmation.tsx b/src/pages/OrderConfirmation.tsx index 0e67198..394deb9 100644 --- a/src/pages/OrderConfirmation.tsx +++ b/src/pages/OrderConfirmation.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OrderConfirmation() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OrderFailed.tsx b/src/pages/OrderFailed.tsx index 26f5ad5..5b94f4a 100644 --- a/src/pages/OrderFailed.tsx +++ b/src/pages/OrderFailed.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OrderFailed() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurExpertise.tsx b/src/pages/OurExpertise.tsx index 3b0fd83..6846d5d 100644 --- a/src/pages/OurExpertise.tsx +++ b/src/pages/OurExpertise.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurExpertise() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurImpact.tsx b/src/pages/OurImpact.tsx index dfce49f..768283b 100644 --- a/src/pages/OurImpact.tsx +++ b/src/pages/OurImpact.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurImpact() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurTeam.tsx b/src/pages/OurTeam.tsx index c2f6441..fe0c72f 100644 --- a/src/pages/OurTeam.tsx +++ b/src/pages/OurTeam.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurTeam() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurVision.tsx b/src/pages/OurVision.tsx index 570a9af..9a45c0a 100644 --- a/src/pages/OurVision.tsx +++ b/src/pages/OurVision.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurVision() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Privacy.tsx b/src/pages/Privacy.tsx index 66bee11..992227d 100644 --- a/src/pages/Privacy.tsx +++ b/src/pages/Privacy.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Shield, Eye, Lock, FileText } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Privacy() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( diff --git a/src/pages/ProgrammeCatalogue.tsx b/src/pages/ProgrammeCatalogue.tsx index 7fe4c2b..0a44590 100644 --- a/src/pages/ProgrammeCatalogue.tsx +++ b/src/pages/ProgrammeCatalogue.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ProgrammeCatalogue() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/ProgrammeDetail.tsx b/src/pages/ProgrammeDetail.tsx index f9a5ad3..eb92efb 100644 --- a/src/pages/ProgrammeDetail.tsx +++ b/src/pages/ProgrammeDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ProgrammeDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Resources.tsx b/src/pages/Resources.tsx index 4c7267d..a433272 100644 --- a/src/pages/Resources.tsx +++ b/src/pages/Resources.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Resources() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index 363c567..482c52c 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -56,13 +56,15 @@ import { HelpCircle, ExternalLink } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +import { useNavigate } from 'react-router-dom'; interface SettingsProps { userType?: 'individual' | 'corporate'; } export function Settings({ userType: propUserType }: SettingsProps) { + + const navigate = useNavigate(); // Enhanced user type detection with multiple fallbacks const getQueryParam = (param: string) => { const urlParams = new URLSearchParams(window.location.search); @@ -1169,7 +1171,7 @@ export function Settings({ userType: propUserType }: SettingsProps) { navigateTo('/privacy')} + onClick={() => navigate('/privacy')} className="text-base min-h-[44px]" > diff --git a/src/pages/Signup.tsx b/src/pages/Signup.tsx index fe255b8..824f37e 100644 --- a/src/pages/Signup.tsx +++ b/src/pages/Signup.tsx @@ -3,7 +3,7 @@ import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Eye, EyeOff, Mail, Lock, User } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Signup() { const [formData, setFormData] = useState({ @@ -24,7 +24,7 @@ export function Signup() { try { // Simulate signup await new Promise(resolve => setTimeout(resolve, 1000)); - navigateTo('/email-verification'); + navigate('/email-verification'); } catch (error) { console.error('Signup failed:', error); } finally { @@ -33,7 +33,7 @@ export function Signup() { }; const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( @@ -195,7 +195,7 @@ export function Signup() { I agree to the{' '} navigateTo('/terms')} + onClick={() => navigate('/terms')} className="text-primary hover:text-primary/80 font-medium" > Terms of Service @@ -203,7 +203,7 @@ export function Signup() { {' '}and{' '} navigateTo('/privacy')} + onClick={() => navigate('/privacy')} className="text-primary hover:text-primary/80 font-medium" > Privacy Policy @@ -224,7 +224,7 @@ export function Signup() { Already have an account?{' '} navigateTo('/auth')} + onClick={() => navigate('/auth')} className="text-primary hover:text-primary/80 font-medium" > Sign in here diff --git a/src/pages/Surveys.tsx b/src/pages/Surveys.tsx index 0c5dcbb..fc3933b 100644 --- a/src/pages/Surveys.tsx +++ b/src/pages/Surveys.tsx @@ -39,9 +39,9 @@ import { Globe, ExternalLink } from 'lucide-react'; -import { navigateTo } from '../components/Router'; import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, PieChart, Pie, Cell } from 'recharts'; import exampleImage from 'figma:asset/c501c3d3f3a828828d4cb2dadb9558b43986718f.png'; +import { useNavigate } from 'react-router-dom'; interface SurveyProps { userType: 'individual' | 'corporate'; @@ -380,6 +380,7 @@ function SurveyCard({ export function Surveys({ userType = 'individual' }: SurveyProps) { const [activeTab, setActiveTab] = useState<'available' | 'completed'>('available'); + const navigate = useNavigate(); // Mock user data for LearnerLayout - matching Library page pattern const user = { diff --git a/src/pages/TeamLeadership.tsx b/src/pages/TeamLeadership.tsx index 8ea2ec3..20f9759 100644 --- a/src/pages/TeamLeadership.tsx +++ b/src/pages/TeamLeadership.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function TeamLeadership() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Terms.tsx b/src/pages/Terms.tsx index 88e82fc..dba47ba 100644 --- a/src/pages/Terms.tsx +++ b/src/pages/Terms.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, FileText, Scale, AlertCircle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Terms() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( diff --git a/src/pages/WebinarDetail.tsx b/src/pages/WebinarDetail.tsx index 78af510..d8fff7d 100644 --- a/src/pages/WebinarDetail.tsx +++ b/src/pages/WebinarDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function WebinarDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/WebinarListing.tsx b/src/pages/WebinarListing.tsx index 9718450..f5e8526 100644 --- a/src/pages/WebinarListing.tsx +++ b/src/pages/WebinarListing.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function WebinarListing() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/learner/CorporateDashboard.tsx b/src/pages/learner/CorporateDashboard.tsx index f4fb94f..8e0109f 100644 --- a/src/pages/learner/CorporateDashboard.tsx +++ b/src/pages/learner/CorporateDashboard.tsx @@ -46,10 +46,10 @@ import { Globe, MapPin } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; import { ImageWithFallback } from '../../components/figma/ImageWithFallback'; import globalMapImage from 'figma:asset/1b56e6afe31d5744d2e7a38d3e2f8c3ce78a90af.png'; - +import { useNavigate } from 'react-router-dom'; + const navigate = useNavigate(); // Loading skeleton component for corporate dashboard function CorporateDashboardSkeleton() { return ( @@ -422,7 +422,7 @@ function CorporateAnalytics() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="text-base h-auto p-0 text-primary hover:text-primary/80" > View Reports @@ -506,7 +506,7 @@ function CorporateAnalytics() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="w-full text-base h-11" > View Detailed Analytics @@ -622,7 +622,7 @@ function AssignedTraining() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="text-base h-10" > View All @@ -639,7 +639,7 @@ function AssignedTraining() { className={`group cursor-pointer bg-white rounded-lg border transition-all duration-200 flex flex-col h-full overflow-hidden ${ assignment.status === 'urgent' ? 'border-destructive/30 bg-destructive/5' : 'border-border hover:shadow-md' }`} - onClick={() => navigateTo(`/library?view=corporate&courseId=${assignment.id}&tab=overview`)} + onClick={() => navigate(`/library?view=corporate&courseId=${assignment.id}&tab=overview`)} > {/* Course Image */} @@ -724,7 +724,7 @@ function AssignedTraining() { className="w-full text-base h-10" onClick={(e) => { e.stopPropagation(); - navigateTo(`/library?view=corporate&courseId=${assignment.id}&tab=overview`); + navigate(`/library?view=corporate&courseId=${assignment.id}&tab=overview`); }} > {assignment.status === 'urgent' ? 'Start Now' : 'Begin Training'} @@ -764,7 +764,7 @@ function TeamLeaderboard() { navigateTo('/leaderboard?view=corporate')} + onClick={() => navigate('/leaderboard?view=corporate')} className="text-base h-10 border-2 border-brand-navy/15 text-brand-navy/80 hover:bg-brand-navy/3 font-semibold" > View All diff --git a/src/pages/learner/CourseTimeline.tsx b/src/pages/learner/CourseTimeline.tsx index df1e7cc..273ec14 100644 --- a/src/pages/learner/CourseTimeline.tsx +++ b/src/pages/learner/CourseTimeline.tsx @@ -43,7 +43,8 @@ import { ChevronDown, ChevronUp } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; interface CourseTimelineProps { userType?: 'individual' | 'corporate'; @@ -458,7 +459,7 @@ function CourseHeader({ course }: { course: Course }) { {/* Breadcrumb Navigation */} navigateTo('/dashboard')} + onClick={() => navigate('/dashboard')} className="hover:text-foreground transition-colors active:bg-gray-100 focus:outline-none px-2 py-1 rounded" style={{ outline: 'none' }} > @@ -466,7 +467,7 @@ function CourseHeader({ course }: { course: Course }) { navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-foreground transition-colors active:bg-gray-100 focus:outline-none px-2 py-1 rounded" style={{ outline: 'none' }} > @@ -962,6 +963,8 @@ export function CourseTimeline({ userType = 'individual' }: CourseTimelineProps) const [activeTab, setActiveTab] = useState('overview'); const [course, setCourse] = useState(null); const [isLoading, setIsLoading] = useState(true); + const navigate = useNavigate(); + // Mock user data const user = { @@ -1017,14 +1020,14 @@ export function CourseTimeline({ userType = 'individual' }: CourseTimelineProps) {/* Breadcrumb Navigation */} navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-[#04045B] transition-colors" > Library navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-[#04045B] transition-colors" > Leadership Development diff --git a/src/pages/learner/Dashboard.tsx b/src/pages/learner/Dashboard.tsx index a16064a..230d693 100644 --- a/src/pages/learner/Dashboard.tsx +++ b/src/pages/learner/Dashboard.tsx @@ -75,13 +75,15 @@ import { Monitor, PieChart } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; +// import { navigate } from '../../components/Router'; import { ImageWithFallback } from '../../components/figma/ImageWithFallback'; import CurrentLearningHeaderIcon from '../../imports/CurrentLearningHeaderIcon-4285-106'; import platinumTrophy from 'figma:asset/a224fb6efc954992c535e482fe88d93f1f4178d8.png'; import goldTrophy from 'figma:asset/9ebc01e8eb24f9d71683b2ee63d224583a979590.png'; import silverTrophy from 'figma:asset/9852710543a90e291ecb85d77ea02234139264c5.png'; import bronzeTrophy from 'figma:asset/5fddc261d2e35ee810113f2537c5a59a97fd7fbd.png'; +import { useNavigate } from 'react-router-dom'; + interface DashboardProps { userType?: 'individual' | 'corporate'; @@ -187,7 +189,7 @@ function RecentActivity() { navigateTo('/dashboard?view=individual&tab=activity')} + onClick={() => navigate('/dashboard?view=individual&tab=activity')} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-3 py-1.5 min-h-[48px] font-medium" > View All @@ -806,7 +808,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi {currentCourse.currentModule.title} navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} className="w-full text-base min-h-[48px] bg-brand-gold hover:bg-brand-gold/90 text-brand-charcoal font-medium" > Continue Module → @@ -826,7 +828,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.nextModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.nextModule.number}`)} className="w-full text-base min-h-[48px] border-brand-navy text-brand-navy hover:bg-brand-navy/10 font-medium" > Preview Module → @@ -840,7 +842,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi Course Modules navigateTo(`/course?view=${userType}&courseId=strategic-leadership`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership`)} className="text-sm text-brand-navy hover:text-brand-navy hover:bg-brand-navy/10 p-0 h-auto font-medium" > View All → @@ -875,7 +877,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership`)} className="text-base text-gray-600 hover:text-gray-900 hover:bg-gray-50 p-0 min-h-[48px] font-medium flex items-center gap-1" > @@ -883,7 +885,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} className="text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium px-6" > @@ -990,7 +992,7 @@ function GlobalLeaderboard() { navigateTo('/leaderboard?view=individual')} + onClick={() => navigate('/leaderboard?view=individual')} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-sm px-3 py-1.5 h-auto font-medium" > View All @@ -1111,7 +1113,7 @@ function ActivityRecommendations({ userType = 'individual' }: { userType?: 'indi navigateTo(`/library?view=${userType}`)} + onClick={() => navigate(`/library?view=${userType}`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View All Courses @@ -1160,7 +1162,7 @@ function ActivityRecommendations({ userType = 'individual' }: { userType?: 'indi {/* Enroll Button */} navigateTo(`/course?view=${userType}&courseId=${course.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${course.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > Enroll Now @@ -1243,7 +1245,7 @@ function RecentlyViewed({ userType = 'individual' }: { userType?: 'individual' | navigateTo(`/library?view=${userType}&filter=recent`)} + onClick={() => navigate(`/library?view=${userType}&filter=recent`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View History @@ -1298,7 +1300,7 @@ function RecentlyViewed({ userType = 'individual' }: { userType?: 'individual' | {/* Action Button */} navigateTo(`/course?view=${userType}&courseId=${item.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${item.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > {item.progress === 100 ? 'Review' : item.progress > 0 ? 'Continue' : 'Start'} @@ -1373,7 +1375,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua navigateTo(`/library?view=${userType}&filter=trending`)} + onClick={() => navigate(`/library?view=${userType}&filter=trending`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View Trending @@ -1422,7 +1424,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua {/* Enroll Button */} navigateTo(`/course?view=${userType}&courseId=${content.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${content.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > Enroll Now @@ -1437,6 +1439,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua // Main Dashboard component export default function Dashboard({ userType = 'individual' }: DashboardProps) { + const navigate = useNavigate(); const user = { name: 'Alex', email: 'alex@example.com' }; return ( diff --git a/src/pages/learner/Library.tsx b/src/pages/learner/Library.tsx index 80f0be9..74a2be1 100644 --- a/src/pages/learner/Library.tsx +++ b/src/pages/learner/Library.tsx @@ -10,7 +10,9 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../components/ui/ta import { Skeleton } from '../../components/ui/skeleton'; import { BookOpen, Filter, Search } from 'lucide-react'; import { getCoursesData, Course } from './data/libraryData'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + interface LibraryProps { userType?: 'individual' | 'corporate'; @@ -51,6 +53,7 @@ function LibrarySkeleton() { export function Library({ userType = 'individual' }: LibraryProps) { const [isLoading, setIsLoading] = useState(true); const [courses] = useState(getCoursesData(userType)); + const navigate = useNavigate(); // Filter states const [searchQuery, setSearchQuery] = useState(''); @@ -155,12 +158,12 @@ export function Library({ userType = 'individual' }: LibraryProps) { const handleEnrollCourse = (courseId: string) => { console.log('Enrolling in course:', courseId); - navigateTo(`/course/${courseId}?view=${userType}`); + navigate(`/course/${courseId}?view=${userType}`); }; const handleContinueCourse = (courseId: string) => { console.log('Continuing course:', courseId); - navigateTo(`/course/${courseId}?view=${userType}`); + navigate(`/course/${courseId}?view=${userType}`); }; const handleBookmarkCourse = (courseId: string) => { diff --git a/src/pages/services/Consulting.tsx b/src/pages/services/Consulting.tsx index 8abe34c..6645666 100644 --- a/src/pages/services/Consulting.tsx +++ b/src/pages/services/Consulting.tsx @@ -1,10 +1,11 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; - +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function Consulting() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/CultureCompetence.tsx b/src/pages/services/CultureCompetence.tsx index c9ef980..f455771 100644 --- a/src/pages/services/CultureCompetence.tsx +++ b/src/pages/services/CultureCompetence.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function CultureCompetence() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/ExecutiveCoaching.tsx b/src/pages/services/ExecutiveCoaching.tsx index f2129f4..c0b7e9c 100644 --- a/src/pages/services/ExecutiveCoaching.tsx +++ b/src/pages/services/ExecutiveCoaching.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function ExecutiveCoaching() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/LeadershipDevelopment.tsx b/src/pages/services/LeadershipDevelopment.tsx index 8e28030..c1ae9c6 100644 --- a/src/pages/services/LeadershipDevelopment.tsx +++ b/src/pages/services/LeadershipDevelopment.tsx @@ -1,10 +1,11 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; - +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function LeadershipDevelopment() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/LearningFacility.tsx b/src/pages/services/LearningFacility.tsx index ab8392a..4884376 100644 --- a/src/pages/services/LearningFacility.tsx +++ b/src/pages/services/LearningFacility.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function LearningFacility() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/ManagementDevelopment.tsx b/src/pages/services/ManagementDevelopment.tsx index efae245..4840d6f 100644 --- a/src/pages/services/ManagementDevelopment.tsx +++ b/src/pages/services/ManagementDevelopment.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function ManagementDevelopment() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null;
{notification.title}
Need corporate access?{' '} navigateTo('/corporate/signup')} + onClick={() => navigate('/corporate/signup')} className="text-primary hover:text-primary/80 font-medium" > Contact your administrator diff --git a/src/pages/CorporateSignup.tsx b/src/pages/CorporateSignup.tsx index c3dd523..cbcef38 100644 --- a/src/pages/CorporateSignup.tsx +++ b/src/pages/CorporateSignup.tsx @@ -3,7 +3,7 @@ import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Mail, User, Building2, Phone, Users } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function CorporateSignup() { const [formData, setFormData] = useState({ @@ -25,7 +25,7 @@ export function CorporateSignup() { try { // Simulate request submission await new Promise(resolve => setTimeout(resolve, 1000)); - navigateTo('/email-verification'); + navigate('/email-verification'); } catch (error) { console.error('Request failed:', error); } finally { @@ -34,7 +34,7 @@ export function CorporateSignup() { }; const handleBackNavigation = () => { - navigateTo('/corporate/auth'); + navigate('/corporate/auth'); }; return ( diff --git a/src/pages/CorporateWebinars.tsx b/src/pages/CorporateWebinars.tsx index 918b309..4ca879a 100644 --- a/src/pages/CorporateWebinars.tsx +++ b/src/pages/CorporateWebinars.tsx @@ -47,9 +47,10 @@ import { MoreHorizontal, Search } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +// const navigate = useNavigate(); import { ImageWithFallback } from '../components/figma/ImageWithFallback'; - +import { useNavigate } from 'react-router-dom'; + const navigate = useNavigate(); // Mock data for webinars const mockWebinars = [ { @@ -266,7 +267,7 @@ function WebinarCard({ webinar }: { webinar: typeof mockWebinars[0] }) { const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false); const handleJoinWebinar = () => { - navigateTo(`/webinar-detail?id=${webinar.id}&view=corporate`); + navigate(`/webinar-detail?id=${webinar.id}&view=corporate`); }; const toggleDescription = (e: React.MouseEvent) => { @@ -637,7 +638,7 @@ export function CorporateWebinars() { navigateTo(`/webinar-detail?id=${webinar.id}&view=corporate`)} + onClick={() => navigate(`/webinar-detail?id=${webinar.id}&view=corporate`)} > @@ -670,7 +671,7 @@ export function CorporateWebinars() { navigateTo('/webinars?view=corporate')} + onClick={() => navigate('/webinars?view=corporate')} className="w-full text-base h-11" > View All Webinars diff --git a/src/pages/EmailVerification.tsx b/src/pages/EmailVerification.tsx index 8f8db8a..17c7c8a 100644 --- a/src/pages/EmailVerification.tsx +++ b/src/pages/EmailVerification.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { Mail, CheckCircle, RefreshCw } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function EmailVerification() { const handleResendEmail = () => { @@ -55,7 +55,7 @@ export function EmailVerification() { navigateTo('/auth')} + onClick={() => navigate('/auth')} className="w-full text-[16px] min-h-[44px] bg-primary hover:bg-primary/90" > Back to Sign In @@ -66,7 +66,7 @@ export function EmailVerification() { Need help? Contact our{' '} navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-primary hover:text-primary/80 font-medium" > support team diff --git a/src/pages/ExecutiveLeadership.tsx b/src/pages/ExecutiveLeadership.tsx index 107b8ff..e172cd2 100644 --- a/src/pages/ExecutiveLeadership.tsx +++ b/src/pages/ExecutiveLeadership.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ExecutiveLeadership() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/FAQ.tsx b/src/pages/FAQ.tsx index b22e5e4..a9a90f3 100644 --- a/src/pages/FAQ.tsx +++ b/src/pages/FAQ.tsx @@ -3,11 +3,11 @@ import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../components/ui/collapsible'; import { ArrowLeft, ChevronDown, HelpCircle, Mail, Phone } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function FAQ() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; const faqData = [ @@ -129,7 +129,7 @@ export function FAQ() { navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[16px] min-h-[44px] bg-primary hover:bg-primary/90" > diff --git a/src/pages/FacilityBooking.tsx b/src/pages/FacilityBooking.tsx index b4770b8..72d4065 100644 --- a/src/pages/FacilityBooking.tsx +++ b/src/pages/FacilityBooking.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function FacilityBooking() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/FacilityDetail.tsx b/src/pages/FacilityDetail.tsx index 646e3fe..e3358a6 100644 --- a/src/pages/FacilityDetail.tsx +++ b/src/pages/FacilityDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function FacilityDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/FacilityTour.tsx b/src/pages/FacilityTour.tsx index db9adad..909d747 100644 --- a/src/pages/FacilityTour.tsx +++ b/src/pages/FacilityTour.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function FacilityTour() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/ForgotPassword.tsx b/src/pages/ForgotPassword.tsx index 7775b58..0a4311c 100644 --- a/src/pages/ForgotPassword.tsx +++ b/src/pages/ForgotPassword.tsx @@ -3,7 +3,7 @@ import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Mail, CheckCircle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ForgotPassword() { const [email, setEmail] = useState(''); @@ -26,7 +26,7 @@ export function ForgotPassword() { }; const handleBackNavigation = () => { - navigateTo('/auth'); + navigate('/auth'); }; if (isSubmitted) { @@ -52,7 +52,7 @@ export function ForgotPassword() { navigateTo('/auth')} + onClick={() => navigate('/auth')} className="w-full text-[16px] min-h-[48px] bg-primary hover:bg-primary/90" > Back to Sign In @@ -137,7 +137,7 @@ export function ForgotPassword() { Remember your password?{' '} navigateTo('/auth')} + onClick={() => navigate('/auth')} className="text-primary hover:text-primary/80 font-medium" > Back to Sign In diff --git a/src/pages/IndividualWebinars.tsx b/src/pages/IndividualWebinars.tsx index 1d433ab..f5f4abc 100644 --- a/src/pages/IndividualWebinars.tsx +++ b/src/pages/IndividualWebinars.tsx @@ -60,7 +60,7 @@ import { Tag, AlertTriangle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +import { useNavigate } from 'react-router-dom'; // Types interface Webinar { @@ -849,6 +849,8 @@ export function IndividualWebinars() { const [filterCategory, setFilterCategory] = useState('all'); const [filterDifficulty, setFilterDifficulty] = useState('all'); const [sortBy, setSortBy] = useState('date'); + const navigate = useNavigate(); + // Mock user data for LearnerLayout - matching Library page pattern const user = { diff --git a/src/pages/InnovationLeadership.tsx b/src/pages/InnovationLeadership.tsx index c8b4b70..433519f 100644 --- a/src/pages/InnovationLeadership.tsx +++ b/src/pages/InnovationLeadership.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function InnovationLeadership() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Leaderboard.tsx b/src/pages/Leaderboard.tsx index e09c2b5..922d119 100644 --- a/src/pages/Leaderboard.tsx +++ b/src/pages/Leaderboard.tsx @@ -37,7 +37,7 @@ import { Shield, Gem } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +import { useNavigate } from 'react-router-dom'; // Types interface LeaderboardEntry { @@ -652,6 +652,8 @@ export function Leaderboard() { const [activeTab, setActiveTab] = useState('global'); const [filterPeriod, setFilterPeriod] = useState('all-time'); const [filterCategory, setFilterCategory] = useState('all'); + const navigate = useNavigate(); + // Mock user data for LearnerLayout - matching Library page pattern const user = { diff --git a/src/pages/LeadershipOnline.tsx b/src/pages/LeadershipOnline.tsx index a3cdb88..54a69eb 100644 --- a/src/pages/LeadershipOnline.tsx +++ b/src/pages/LeadershipOnline.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function LeadershipOnline() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Login.tsx b/src/pages/Login.tsx index 478733b..3c0fe93 100644 --- a/src/pages/Login.tsx +++ b/src/pages/Login.tsx @@ -3,8 +3,9 @@ import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Eye, EyeOff, Mail, Lock } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); import { useAuth } from '../components/AuthContext'; +import { useNavigate } from 'react-router-dom'; export function Login() { const [email, setEmail] = useState(''); @@ -20,11 +21,11 @@ export function Login() { try { // Simulate login and go directly to individual dashboard await login(email || 'demo@klc.edu', password || 'demo'); - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); } catch (error) { console.error('Login failed:', error); // Even if login fails, still navigate to dashboard for ease of use - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); } finally { setIsLoading(false); } @@ -34,16 +35,16 @@ export function Login() { // Direct navigation to individual dashboard without form validation setIsLoading(true); login('demo@klc.edu', 'demo').then(() => { - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); }).catch(() => { - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); }).finally(() => { setIsLoading(false); }); }; const handleBackNavigation = () => { - navigateTo('/auth'); + navigate('/auth'); }; return ( @@ -166,7 +167,7 @@ export function Login() { navigateTo('/forgot-password')} + onClick={() => navigate('/forgot-password')} className="text-[16px] text-primary hover:text-primary/80 font-medium" > Forgot password? @@ -186,7 +187,7 @@ export function Login() { Don't have an account?{' '} navigateTo('/signup')} + onClick={() => navigate('/signup')} className="text-primary hover:text-primary/80 font-medium" > Create one here diff --git a/src/pages/LoginSelection.tsx b/src/pages/LoginSelection.tsx index 802bccb..2f85860 100644 --- a/src/pages/LoginSelection.tsx +++ b/src/pages/LoginSelection.tsx @@ -3,31 +3,32 @@ import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { Badge } from '../components/ui/badge'; import { ArrowLeft, Building2, User, ArrowRight, CheckCircle, Users, Target, BookOpen, Video, Award, BarChart3 } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +// const navigate = useNavigate(); import { useAuth } from '../components/AuthContext'; - +import { useNavigate } from 'react-router-dom'; + const navigate = useNavigate(); export function LoginSelection() { const { login } = useAuth(); const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; const handleIndividualLogin = () => { // Direct navigation to individual dashboard login('demo@klc.edu', 'demo').then(() => { - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); }).catch(() => { - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); }); }; const handleCorporateLogin = () => { // Direct navigation to corporate dashboard login('corporate@klc.edu', 'demo').then(() => { - navigateTo('/dashboard?view=corporate'); + navigate('/dashboard?view=corporate'); }).catch(() => { - navigateTo('/dashboard?view=corporate'); + navigate('/dashboard?view=corporate'); }); }; @@ -145,7 +146,7 @@ export function LoginSelection() { Want to explore first?{' '} navigateTo('/login')} + onClick={() => navigate('/login')} className="text-blue-600 hover:text-blue-700 font-medium hover:underline" > View login options @@ -237,7 +238,7 @@ export function LoginSelection() { Want to explore first?{' '} navigateTo('/corporate/login')} + onClick={() => navigate('/corporate/login')} className="text-purple-600 hover:text-purple-700 font-medium hover:underline" > View login options @@ -285,14 +286,14 @@ export function LoginSelection() { navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[16px] min-h-[44px] border-[#04045B] text-[#04045B] hover:bg-[#04045B]/10" > Contact Support navigateTo('/individual-webinars')} + onClick={() => navigate('/individual-webinars')} className="text-[16px] min-h-[44px] border-[#04045B] text-[#04045B] hover:bg-[#04045B]/10" > Explore Learning Resources diff --git a/src/pages/MyCohort.tsx b/src/pages/MyCohort.tsx index cf0eb25..0613ebc 100644 --- a/src/pages/MyCohort.tsx +++ b/src/pages/MyCohort.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function MyCohort() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/NotFound.tsx b/src/pages/NotFound.tsx index 32f2c61..4964d76 100644 --- a/src/pages/NotFound.tsx +++ b/src/pages/NotFound.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent } from '../components/ui/card'; import { ArrowLeft, Home, Search, HelpCircle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function NotFound() { const handleGoHome = () => { - navigateTo('/'); + navigate('/'); }; const handleGoBack = () => { @@ -56,7 +56,7 @@ export function NotFound() { navigateTo('/individual-webinars')} + onClick={() => navigate('/individual-webinars')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -64,7 +64,7 @@ export function NotFound() { navigateTo('/contact')} + onClick={() => navigate('/contact')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -72,7 +72,7 @@ export function NotFound() { navigateTo('/auth')} + onClick={() => navigate('/auth')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -86,7 +86,7 @@ export function NotFound() { Still need help? Contact our{' '} navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[#04045B] hover:text-[#04045B]/80 font-medium" > support team diff --git a/src/pages/OrderConfirmation.tsx b/src/pages/OrderConfirmation.tsx index 0e67198..394deb9 100644 --- a/src/pages/OrderConfirmation.tsx +++ b/src/pages/OrderConfirmation.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OrderConfirmation() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OrderFailed.tsx b/src/pages/OrderFailed.tsx index 26f5ad5..5b94f4a 100644 --- a/src/pages/OrderFailed.tsx +++ b/src/pages/OrderFailed.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OrderFailed() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurExpertise.tsx b/src/pages/OurExpertise.tsx index 3b0fd83..6846d5d 100644 --- a/src/pages/OurExpertise.tsx +++ b/src/pages/OurExpertise.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurExpertise() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurImpact.tsx b/src/pages/OurImpact.tsx index dfce49f..768283b 100644 --- a/src/pages/OurImpact.tsx +++ b/src/pages/OurImpact.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurImpact() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurTeam.tsx b/src/pages/OurTeam.tsx index c2f6441..fe0c72f 100644 --- a/src/pages/OurTeam.tsx +++ b/src/pages/OurTeam.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurTeam() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurVision.tsx b/src/pages/OurVision.tsx index 570a9af..9a45c0a 100644 --- a/src/pages/OurVision.tsx +++ b/src/pages/OurVision.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurVision() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Privacy.tsx b/src/pages/Privacy.tsx index 66bee11..992227d 100644 --- a/src/pages/Privacy.tsx +++ b/src/pages/Privacy.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Shield, Eye, Lock, FileText } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Privacy() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( diff --git a/src/pages/ProgrammeCatalogue.tsx b/src/pages/ProgrammeCatalogue.tsx index 7fe4c2b..0a44590 100644 --- a/src/pages/ProgrammeCatalogue.tsx +++ b/src/pages/ProgrammeCatalogue.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ProgrammeCatalogue() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/ProgrammeDetail.tsx b/src/pages/ProgrammeDetail.tsx index f9a5ad3..eb92efb 100644 --- a/src/pages/ProgrammeDetail.tsx +++ b/src/pages/ProgrammeDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ProgrammeDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Resources.tsx b/src/pages/Resources.tsx index 4c7267d..a433272 100644 --- a/src/pages/Resources.tsx +++ b/src/pages/Resources.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Resources() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index 363c567..482c52c 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -56,13 +56,15 @@ import { HelpCircle, ExternalLink } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +import { useNavigate } from 'react-router-dom'; interface SettingsProps { userType?: 'individual' | 'corporate'; } export function Settings({ userType: propUserType }: SettingsProps) { + + const navigate = useNavigate(); // Enhanced user type detection with multiple fallbacks const getQueryParam = (param: string) => { const urlParams = new URLSearchParams(window.location.search); @@ -1169,7 +1171,7 @@ export function Settings({ userType: propUserType }: SettingsProps) { navigateTo('/privacy')} + onClick={() => navigate('/privacy')} className="text-base min-h-[44px]" > diff --git a/src/pages/Signup.tsx b/src/pages/Signup.tsx index fe255b8..824f37e 100644 --- a/src/pages/Signup.tsx +++ b/src/pages/Signup.tsx @@ -3,7 +3,7 @@ import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Eye, EyeOff, Mail, Lock, User } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Signup() { const [formData, setFormData] = useState({ @@ -24,7 +24,7 @@ export function Signup() { try { // Simulate signup await new Promise(resolve => setTimeout(resolve, 1000)); - navigateTo('/email-verification'); + navigate('/email-verification'); } catch (error) { console.error('Signup failed:', error); } finally { @@ -33,7 +33,7 @@ export function Signup() { }; const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( @@ -195,7 +195,7 @@ export function Signup() { I agree to the{' '} navigateTo('/terms')} + onClick={() => navigate('/terms')} className="text-primary hover:text-primary/80 font-medium" > Terms of Service @@ -203,7 +203,7 @@ export function Signup() { {' '}and{' '} navigateTo('/privacy')} + onClick={() => navigate('/privacy')} className="text-primary hover:text-primary/80 font-medium" > Privacy Policy @@ -224,7 +224,7 @@ export function Signup() { Already have an account?{' '} navigateTo('/auth')} + onClick={() => navigate('/auth')} className="text-primary hover:text-primary/80 font-medium" > Sign in here diff --git a/src/pages/Surveys.tsx b/src/pages/Surveys.tsx index 0c5dcbb..fc3933b 100644 --- a/src/pages/Surveys.tsx +++ b/src/pages/Surveys.tsx @@ -39,9 +39,9 @@ import { Globe, ExternalLink } from 'lucide-react'; -import { navigateTo } from '../components/Router'; import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, PieChart, Pie, Cell } from 'recharts'; import exampleImage from 'figma:asset/c501c3d3f3a828828d4cb2dadb9558b43986718f.png'; +import { useNavigate } from 'react-router-dom'; interface SurveyProps { userType: 'individual' | 'corporate'; @@ -380,6 +380,7 @@ function SurveyCard({ export function Surveys({ userType = 'individual' }: SurveyProps) { const [activeTab, setActiveTab] = useState<'available' | 'completed'>('available'); + const navigate = useNavigate(); // Mock user data for LearnerLayout - matching Library page pattern const user = { diff --git a/src/pages/TeamLeadership.tsx b/src/pages/TeamLeadership.tsx index 8ea2ec3..20f9759 100644 --- a/src/pages/TeamLeadership.tsx +++ b/src/pages/TeamLeadership.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function TeamLeadership() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Terms.tsx b/src/pages/Terms.tsx index 88e82fc..dba47ba 100644 --- a/src/pages/Terms.tsx +++ b/src/pages/Terms.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, FileText, Scale, AlertCircle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Terms() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( diff --git a/src/pages/WebinarDetail.tsx b/src/pages/WebinarDetail.tsx index 78af510..d8fff7d 100644 --- a/src/pages/WebinarDetail.tsx +++ b/src/pages/WebinarDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function WebinarDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/WebinarListing.tsx b/src/pages/WebinarListing.tsx index 9718450..f5e8526 100644 --- a/src/pages/WebinarListing.tsx +++ b/src/pages/WebinarListing.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function WebinarListing() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/learner/CorporateDashboard.tsx b/src/pages/learner/CorporateDashboard.tsx index f4fb94f..8e0109f 100644 --- a/src/pages/learner/CorporateDashboard.tsx +++ b/src/pages/learner/CorporateDashboard.tsx @@ -46,10 +46,10 @@ import { Globe, MapPin } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; import { ImageWithFallback } from '../../components/figma/ImageWithFallback'; import globalMapImage from 'figma:asset/1b56e6afe31d5744d2e7a38d3e2f8c3ce78a90af.png'; - +import { useNavigate } from 'react-router-dom'; + const navigate = useNavigate(); // Loading skeleton component for corporate dashboard function CorporateDashboardSkeleton() { return ( @@ -422,7 +422,7 @@ function CorporateAnalytics() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="text-base h-auto p-0 text-primary hover:text-primary/80" > View Reports @@ -506,7 +506,7 @@ function CorporateAnalytics() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="w-full text-base h-11" > View Detailed Analytics @@ -622,7 +622,7 @@ function AssignedTraining() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="text-base h-10" > View All @@ -639,7 +639,7 @@ function AssignedTraining() { className={`group cursor-pointer bg-white rounded-lg border transition-all duration-200 flex flex-col h-full overflow-hidden ${ assignment.status === 'urgent' ? 'border-destructive/30 bg-destructive/5' : 'border-border hover:shadow-md' }`} - onClick={() => navigateTo(`/library?view=corporate&courseId=${assignment.id}&tab=overview`)} + onClick={() => navigate(`/library?view=corporate&courseId=${assignment.id}&tab=overview`)} > {/* Course Image */} @@ -724,7 +724,7 @@ function AssignedTraining() { className="w-full text-base h-10" onClick={(e) => { e.stopPropagation(); - navigateTo(`/library?view=corporate&courseId=${assignment.id}&tab=overview`); + navigate(`/library?view=corporate&courseId=${assignment.id}&tab=overview`); }} > {assignment.status === 'urgent' ? 'Start Now' : 'Begin Training'} @@ -764,7 +764,7 @@ function TeamLeaderboard() { navigateTo('/leaderboard?view=corporate')} + onClick={() => navigate('/leaderboard?view=corporate')} className="text-base h-10 border-2 border-brand-navy/15 text-brand-navy/80 hover:bg-brand-navy/3 font-semibold" > View All diff --git a/src/pages/learner/CourseTimeline.tsx b/src/pages/learner/CourseTimeline.tsx index df1e7cc..273ec14 100644 --- a/src/pages/learner/CourseTimeline.tsx +++ b/src/pages/learner/CourseTimeline.tsx @@ -43,7 +43,8 @@ import { ChevronDown, ChevronUp } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; interface CourseTimelineProps { userType?: 'individual' | 'corporate'; @@ -458,7 +459,7 @@ function CourseHeader({ course }: { course: Course }) { {/* Breadcrumb Navigation */} navigateTo('/dashboard')} + onClick={() => navigate('/dashboard')} className="hover:text-foreground transition-colors active:bg-gray-100 focus:outline-none px-2 py-1 rounded" style={{ outline: 'none' }} > @@ -466,7 +467,7 @@ function CourseHeader({ course }: { course: Course }) { navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-foreground transition-colors active:bg-gray-100 focus:outline-none px-2 py-1 rounded" style={{ outline: 'none' }} > @@ -962,6 +963,8 @@ export function CourseTimeline({ userType = 'individual' }: CourseTimelineProps) const [activeTab, setActiveTab] = useState('overview'); const [course, setCourse] = useState(null); const [isLoading, setIsLoading] = useState(true); + const navigate = useNavigate(); + // Mock user data const user = { @@ -1017,14 +1020,14 @@ export function CourseTimeline({ userType = 'individual' }: CourseTimelineProps) {/* Breadcrumb Navigation */} navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-[#04045B] transition-colors" > Library navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-[#04045B] transition-colors" > Leadership Development diff --git a/src/pages/learner/Dashboard.tsx b/src/pages/learner/Dashboard.tsx index a16064a..230d693 100644 --- a/src/pages/learner/Dashboard.tsx +++ b/src/pages/learner/Dashboard.tsx @@ -75,13 +75,15 @@ import { Monitor, PieChart } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; +// import { navigate } from '../../components/Router'; import { ImageWithFallback } from '../../components/figma/ImageWithFallback'; import CurrentLearningHeaderIcon from '../../imports/CurrentLearningHeaderIcon-4285-106'; import platinumTrophy from 'figma:asset/a224fb6efc954992c535e482fe88d93f1f4178d8.png'; import goldTrophy from 'figma:asset/9ebc01e8eb24f9d71683b2ee63d224583a979590.png'; import silverTrophy from 'figma:asset/9852710543a90e291ecb85d77ea02234139264c5.png'; import bronzeTrophy from 'figma:asset/5fddc261d2e35ee810113f2537c5a59a97fd7fbd.png'; +import { useNavigate } from 'react-router-dom'; + interface DashboardProps { userType?: 'individual' | 'corporate'; @@ -187,7 +189,7 @@ function RecentActivity() { navigateTo('/dashboard?view=individual&tab=activity')} + onClick={() => navigate('/dashboard?view=individual&tab=activity')} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-3 py-1.5 min-h-[48px] font-medium" > View All @@ -806,7 +808,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi {currentCourse.currentModule.title} navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} className="w-full text-base min-h-[48px] bg-brand-gold hover:bg-brand-gold/90 text-brand-charcoal font-medium" > Continue Module → @@ -826,7 +828,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.nextModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.nextModule.number}`)} className="w-full text-base min-h-[48px] border-brand-navy text-brand-navy hover:bg-brand-navy/10 font-medium" > Preview Module → @@ -840,7 +842,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi Course Modules navigateTo(`/course?view=${userType}&courseId=strategic-leadership`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership`)} className="text-sm text-brand-navy hover:text-brand-navy hover:bg-brand-navy/10 p-0 h-auto font-medium" > View All → @@ -875,7 +877,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership`)} className="text-base text-gray-600 hover:text-gray-900 hover:bg-gray-50 p-0 min-h-[48px] font-medium flex items-center gap-1" > @@ -883,7 +885,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} className="text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium px-6" > @@ -990,7 +992,7 @@ function GlobalLeaderboard() { navigateTo('/leaderboard?view=individual')} + onClick={() => navigate('/leaderboard?view=individual')} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-sm px-3 py-1.5 h-auto font-medium" > View All @@ -1111,7 +1113,7 @@ function ActivityRecommendations({ userType = 'individual' }: { userType?: 'indi navigateTo(`/library?view=${userType}`)} + onClick={() => navigate(`/library?view=${userType}`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View All Courses @@ -1160,7 +1162,7 @@ function ActivityRecommendations({ userType = 'individual' }: { userType?: 'indi {/* Enroll Button */} navigateTo(`/course?view=${userType}&courseId=${course.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${course.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > Enroll Now @@ -1243,7 +1245,7 @@ function RecentlyViewed({ userType = 'individual' }: { userType?: 'individual' | navigateTo(`/library?view=${userType}&filter=recent`)} + onClick={() => navigate(`/library?view=${userType}&filter=recent`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View History @@ -1298,7 +1300,7 @@ function RecentlyViewed({ userType = 'individual' }: { userType?: 'individual' | {/* Action Button */} navigateTo(`/course?view=${userType}&courseId=${item.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${item.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > {item.progress === 100 ? 'Review' : item.progress > 0 ? 'Continue' : 'Start'} @@ -1373,7 +1375,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua navigateTo(`/library?view=${userType}&filter=trending`)} + onClick={() => navigate(`/library?view=${userType}&filter=trending`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View Trending @@ -1422,7 +1424,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua {/* Enroll Button */} navigateTo(`/course?view=${userType}&courseId=${content.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${content.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > Enroll Now @@ -1437,6 +1439,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua // Main Dashboard component export default function Dashboard({ userType = 'individual' }: DashboardProps) { + const navigate = useNavigate(); const user = { name: 'Alex', email: 'alex@example.com' }; return ( diff --git a/src/pages/learner/Library.tsx b/src/pages/learner/Library.tsx index 80f0be9..74a2be1 100644 --- a/src/pages/learner/Library.tsx +++ b/src/pages/learner/Library.tsx @@ -10,7 +10,9 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../components/ui/ta import { Skeleton } from '../../components/ui/skeleton'; import { BookOpen, Filter, Search } from 'lucide-react'; import { getCoursesData, Course } from './data/libraryData'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + interface LibraryProps { userType?: 'individual' | 'corporate'; @@ -51,6 +53,7 @@ function LibrarySkeleton() { export function Library({ userType = 'individual' }: LibraryProps) { const [isLoading, setIsLoading] = useState(true); const [courses] = useState(getCoursesData(userType)); + const navigate = useNavigate(); // Filter states const [searchQuery, setSearchQuery] = useState(''); @@ -155,12 +158,12 @@ export function Library({ userType = 'individual' }: LibraryProps) { const handleEnrollCourse = (courseId: string) => { console.log('Enrolling in course:', courseId); - navigateTo(`/course/${courseId}?view=${userType}`); + navigate(`/course/${courseId}?view=${userType}`); }; const handleContinueCourse = (courseId: string) => { console.log('Continuing course:', courseId); - navigateTo(`/course/${courseId}?view=${userType}`); + navigate(`/course/${courseId}?view=${userType}`); }; const handleBookmarkCourse = (courseId: string) => { diff --git a/src/pages/services/Consulting.tsx b/src/pages/services/Consulting.tsx index 8abe34c..6645666 100644 --- a/src/pages/services/Consulting.tsx +++ b/src/pages/services/Consulting.tsx @@ -1,10 +1,11 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; - +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function Consulting() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/CultureCompetence.tsx b/src/pages/services/CultureCompetence.tsx index c9ef980..f455771 100644 --- a/src/pages/services/CultureCompetence.tsx +++ b/src/pages/services/CultureCompetence.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function CultureCompetence() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/ExecutiveCoaching.tsx b/src/pages/services/ExecutiveCoaching.tsx index f2129f4..c0b7e9c 100644 --- a/src/pages/services/ExecutiveCoaching.tsx +++ b/src/pages/services/ExecutiveCoaching.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function ExecutiveCoaching() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/LeadershipDevelopment.tsx b/src/pages/services/LeadershipDevelopment.tsx index 8e28030..c1ae9c6 100644 --- a/src/pages/services/LeadershipDevelopment.tsx +++ b/src/pages/services/LeadershipDevelopment.tsx @@ -1,10 +1,11 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; - +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function LeadershipDevelopment() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/LearningFacility.tsx b/src/pages/services/LearningFacility.tsx index ab8392a..4884376 100644 --- a/src/pages/services/LearningFacility.tsx +++ b/src/pages/services/LearningFacility.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function LearningFacility() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/ManagementDevelopment.tsx b/src/pages/services/ManagementDevelopment.tsx index efae245..4840d6f 100644 --- a/src/pages/services/ManagementDevelopment.tsx +++ b/src/pages/services/ManagementDevelopment.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function ManagementDevelopment() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null;
Need help? Contact our{' '} navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-primary hover:text-primary/80 font-medium" > support team diff --git a/src/pages/ExecutiveLeadership.tsx b/src/pages/ExecutiveLeadership.tsx index 107b8ff..e172cd2 100644 --- a/src/pages/ExecutiveLeadership.tsx +++ b/src/pages/ExecutiveLeadership.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ExecutiveLeadership() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/FAQ.tsx b/src/pages/FAQ.tsx index b22e5e4..a9a90f3 100644 --- a/src/pages/FAQ.tsx +++ b/src/pages/FAQ.tsx @@ -3,11 +3,11 @@ import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../components/ui/collapsible'; import { ArrowLeft, ChevronDown, HelpCircle, Mail, Phone } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function FAQ() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; const faqData = [ @@ -129,7 +129,7 @@ export function FAQ() {
Remember your password?{' '} navigateTo('/auth')} + onClick={() => navigate('/auth')} className="text-primary hover:text-primary/80 font-medium" > Back to Sign In diff --git a/src/pages/IndividualWebinars.tsx b/src/pages/IndividualWebinars.tsx index 1d433ab..f5f4abc 100644 --- a/src/pages/IndividualWebinars.tsx +++ b/src/pages/IndividualWebinars.tsx @@ -60,7 +60,7 @@ import { Tag, AlertTriangle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +import { useNavigate } from 'react-router-dom'; // Types interface Webinar { @@ -849,6 +849,8 @@ export function IndividualWebinars() { const [filterCategory, setFilterCategory] = useState('all'); const [filterDifficulty, setFilterDifficulty] = useState('all'); const [sortBy, setSortBy] = useState('date'); + const navigate = useNavigate(); + // Mock user data for LearnerLayout - matching Library page pattern const user = { diff --git a/src/pages/InnovationLeadership.tsx b/src/pages/InnovationLeadership.tsx index c8b4b70..433519f 100644 --- a/src/pages/InnovationLeadership.tsx +++ b/src/pages/InnovationLeadership.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function InnovationLeadership() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Leaderboard.tsx b/src/pages/Leaderboard.tsx index e09c2b5..922d119 100644 --- a/src/pages/Leaderboard.tsx +++ b/src/pages/Leaderboard.tsx @@ -37,7 +37,7 @@ import { Shield, Gem } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +import { useNavigate } from 'react-router-dom'; // Types interface LeaderboardEntry { @@ -652,6 +652,8 @@ export function Leaderboard() { const [activeTab, setActiveTab] = useState('global'); const [filterPeriod, setFilterPeriod] = useState('all-time'); const [filterCategory, setFilterCategory] = useState('all'); + const navigate = useNavigate(); + // Mock user data for LearnerLayout - matching Library page pattern const user = { diff --git a/src/pages/LeadershipOnline.tsx b/src/pages/LeadershipOnline.tsx index a3cdb88..54a69eb 100644 --- a/src/pages/LeadershipOnline.tsx +++ b/src/pages/LeadershipOnline.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function LeadershipOnline() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Login.tsx b/src/pages/Login.tsx index 478733b..3c0fe93 100644 --- a/src/pages/Login.tsx +++ b/src/pages/Login.tsx @@ -3,8 +3,9 @@ import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Eye, EyeOff, Mail, Lock } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); import { useAuth } from '../components/AuthContext'; +import { useNavigate } from 'react-router-dom'; export function Login() { const [email, setEmail] = useState(''); @@ -20,11 +21,11 @@ export function Login() { try { // Simulate login and go directly to individual dashboard await login(email || 'demo@klc.edu', password || 'demo'); - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); } catch (error) { console.error('Login failed:', error); // Even if login fails, still navigate to dashboard for ease of use - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); } finally { setIsLoading(false); } @@ -34,16 +35,16 @@ export function Login() { // Direct navigation to individual dashboard without form validation setIsLoading(true); login('demo@klc.edu', 'demo').then(() => { - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); }).catch(() => { - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); }).finally(() => { setIsLoading(false); }); }; const handleBackNavigation = () => { - navigateTo('/auth'); + navigate('/auth'); }; return ( @@ -166,7 +167,7 @@ export function Login() { navigateTo('/forgot-password')} + onClick={() => navigate('/forgot-password')} className="text-[16px] text-primary hover:text-primary/80 font-medium" > Forgot password? @@ -186,7 +187,7 @@ export function Login() { Don't have an account?{' '} navigateTo('/signup')} + onClick={() => navigate('/signup')} className="text-primary hover:text-primary/80 font-medium" > Create one here diff --git a/src/pages/LoginSelection.tsx b/src/pages/LoginSelection.tsx index 802bccb..2f85860 100644 --- a/src/pages/LoginSelection.tsx +++ b/src/pages/LoginSelection.tsx @@ -3,31 +3,32 @@ import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { Badge } from '../components/ui/badge'; import { ArrowLeft, Building2, User, ArrowRight, CheckCircle, Users, Target, BookOpen, Video, Award, BarChart3 } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +// const navigate = useNavigate(); import { useAuth } from '../components/AuthContext'; - +import { useNavigate } from 'react-router-dom'; + const navigate = useNavigate(); export function LoginSelection() { const { login } = useAuth(); const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; const handleIndividualLogin = () => { // Direct navigation to individual dashboard login('demo@klc.edu', 'demo').then(() => { - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); }).catch(() => { - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); }); }; const handleCorporateLogin = () => { // Direct navigation to corporate dashboard login('corporate@klc.edu', 'demo').then(() => { - navigateTo('/dashboard?view=corporate'); + navigate('/dashboard?view=corporate'); }).catch(() => { - navigateTo('/dashboard?view=corporate'); + navigate('/dashboard?view=corporate'); }); }; @@ -145,7 +146,7 @@ export function LoginSelection() { Want to explore first?{' '} navigateTo('/login')} + onClick={() => navigate('/login')} className="text-blue-600 hover:text-blue-700 font-medium hover:underline" > View login options @@ -237,7 +238,7 @@ export function LoginSelection() { Want to explore first?{' '} navigateTo('/corporate/login')} + onClick={() => navigate('/corporate/login')} className="text-purple-600 hover:text-purple-700 font-medium hover:underline" > View login options @@ -285,14 +286,14 @@ export function LoginSelection() { navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[16px] min-h-[44px] border-[#04045B] text-[#04045B] hover:bg-[#04045B]/10" > Contact Support navigateTo('/individual-webinars')} + onClick={() => navigate('/individual-webinars')} className="text-[16px] min-h-[44px] border-[#04045B] text-[#04045B] hover:bg-[#04045B]/10" > Explore Learning Resources diff --git a/src/pages/MyCohort.tsx b/src/pages/MyCohort.tsx index cf0eb25..0613ebc 100644 --- a/src/pages/MyCohort.tsx +++ b/src/pages/MyCohort.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function MyCohort() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/NotFound.tsx b/src/pages/NotFound.tsx index 32f2c61..4964d76 100644 --- a/src/pages/NotFound.tsx +++ b/src/pages/NotFound.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent } from '../components/ui/card'; import { ArrowLeft, Home, Search, HelpCircle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function NotFound() { const handleGoHome = () => { - navigateTo('/'); + navigate('/'); }; const handleGoBack = () => { @@ -56,7 +56,7 @@ export function NotFound() { navigateTo('/individual-webinars')} + onClick={() => navigate('/individual-webinars')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -64,7 +64,7 @@ export function NotFound() { navigateTo('/contact')} + onClick={() => navigate('/contact')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -72,7 +72,7 @@ export function NotFound() { navigateTo('/auth')} + onClick={() => navigate('/auth')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -86,7 +86,7 @@ export function NotFound() { Still need help? Contact our{' '} navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[#04045B] hover:text-[#04045B]/80 font-medium" > support team diff --git a/src/pages/OrderConfirmation.tsx b/src/pages/OrderConfirmation.tsx index 0e67198..394deb9 100644 --- a/src/pages/OrderConfirmation.tsx +++ b/src/pages/OrderConfirmation.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OrderConfirmation() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OrderFailed.tsx b/src/pages/OrderFailed.tsx index 26f5ad5..5b94f4a 100644 --- a/src/pages/OrderFailed.tsx +++ b/src/pages/OrderFailed.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OrderFailed() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurExpertise.tsx b/src/pages/OurExpertise.tsx index 3b0fd83..6846d5d 100644 --- a/src/pages/OurExpertise.tsx +++ b/src/pages/OurExpertise.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurExpertise() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurImpact.tsx b/src/pages/OurImpact.tsx index dfce49f..768283b 100644 --- a/src/pages/OurImpact.tsx +++ b/src/pages/OurImpact.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurImpact() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurTeam.tsx b/src/pages/OurTeam.tsx index c2f6441..fe0c72f 100644 --- a/src/pages/OurTeam.tsx +++ b/src/pages/OurTeam.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurTeam() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurVision.tsx b/src/pages/OurVision.tsx index 570a9af..9a45c0a 100644 --- a/src/pages/OurVision.tsx +++ b/src/pages/OurVision.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurVision() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Privacy.tsx b/src/pages/Privacy.tsx index 66bee11..992227d 100644 --- a/src/pages/Privacy.tsx +++ b/src/pages/Privacy.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Shield, Eye, Lock, FileText } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Privacy() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( diff --git a/src/pages/ProgrammeCatalogue.tsx b/src/pages/ProgrammeCatalogue.tsx index 7fe4c2b..0a44590 100644 --- a/src/pages/ProgrammeCatalogue.tsx +++ b/src/pages/ProgrammeCatalogue.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ProgrammeCatalogue() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/ProgrammeDetail.tsx b/src/pages/ProgrammeDetail.tsx index f9a5ad3..eb92efb 100644 --- a/src/pages/ProgrammeDetail.tsx +++ b/src/pages/ProgrammeDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ProgrammeDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Resources.tsx b/src/pages/Resources.tsx index 4c7267d..a433272 100644 --- a/src/pages/Resources.tsx +++ b/src/pages/Resources.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Resources() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index 363c567..482c52c 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -56,13 +56,15 @@ import { HelpCircle, ExternalLink } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +import { useNavigate } from 'react-router-dom'; interface SettingsProps { userType?: 'individual' | 'corporate'; } export function Settings({ userType: propUserType }: SettingsProps) { + + const navigate = useNavigate(); // Enhanced user type detection with multiple fallbacks const getQueryParam = (param: string) => { const urlParams = new URLSearchParams(window.location.search); @@ -1169,7 +1171,7 @@ export function Settings({ userType: propUserType }: SettingsProps) { navigateTo('/privacy')} + onClick={() => navigate('/privacy')} className="text-base min-h-[44px]" > diff --git a/src/pages/Signup.tsx b/src/pages/Signup.tsx index fe255b8..824f37e 100644 --- a/src/pages/Signup.tsx +++ b/src/pages/Signup.tsx @@ -3,7 +3,7 @@ import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Eye, EyeOff, Mail, Lock, User } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Signup() { const [formData, setFormData] = useState({ @@ -24,7 +24,7 @@ export function Signup() { try { // Simulate signup await new Promise(resolve => setTimeout(resolve, 1000)); - navigateTo('/email-verification'); + navigate('/email-verification'); } catch (error) { console.error('Signup failed:', error); } finally { @@ -33,7 +33,7 @@ export function Signup() { }; const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( @@ -195,7 +195,7 @@ export function Signup() { I agree to the{' '} navigateTo('/terms')} + onClick={() => navigate('/terms')} className="text-primary hover:text-primary/80 font-medium" > Terms of Service @@ -203,7 +203,7 @@ export function Signup() { {' '}and{' '} navigateTo('/privacy')} + onClick={() => navigate('/privacy')} className="text-primary hover:text-primary/80 font-medium" > Privacy Policy @@ -224,7 +224,7 @@ export function Signup() { Already have an account?{' '} navigateTo('/auth')} + onClick={() => navigate('/auth')} className="text-primary hover:text-primary/80 font-medium" > Sign in here diff --git a/src/pages/Surveys.tsx b/src/pages/Surveys.tsx index 0c5dcbb..fc3933b 100644 --- a/src/pages/Surveys.tsx +++ b/src/pages/Surveys.tsx @@ -39,9 +39,9 @@ import { Globe, ExternalLink } from 'lucide-react'; -import { navigateTo } from '../components/Router'; import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, PieChart, Pie, Cell } from 'recharts'; import exampleImage from 'figma:asset/c501c3d3f3a828828d4cb2dadb9558b43986718f.png'; +import { useNavigate } from 'react-router-dom'; interface SurveyProps { userType: 'individual' | 'corporate'; @@ -380,6 +380,7 @@ function SurveyCard({ export function Surveys({ userType = 'individual' }: SurveyProps) { const [activeTab, setActiveTab] = useState<'available' | 'completed'>('available'); + const navigate = useNavigate(); // Mock user data for LearnerLayout - matching Library page pattern const user = { diff --git a/src/pages/TeamLeadership.tsx b/src/pages/TeamLeadership.tsx index 8ea2ec3..20f9759 100644 --- a/src/pages/TeamLeadership.tsx +++ b/src/pages/TeamLeadership.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function TeamLeadership() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Terms.tsx b/src/pages/Terms.tsx index 88e82fc..dba47ba 100644 --- a/src/pages/Terms.tsx +++ b/src/pages/Terms.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, FileText, Scale, AlertCircle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Terms() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( diff --git a/src/pages/WebinarDetail.tsx b/src/pages/WebinarDetail.tsx index 78af510..d8fff7d 100644 --- a/src/pages/WebinarDetail.tsx +++ b/src/pages/WebinarDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function WebinarDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/WebinarListing.tsx b/src/pages/WebinarListing.tsx index 9718450..f5e8526 100644 --- a/src/pages/WebinarListing.tsx +++ b/src/pages/WebinarListing.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function WebinarListing() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/learner/CorporateDashboard.tsx b/src/pages/learner/CorporateDashboard.tsx index f4fb94f..8e0109f 100644 --- a/src/pages/learner/CorporateDashboard.tsx +++ b/src/pages/learner/CorporateDashboard.tsx @@ -46,10 +46,10 @@ import { Globe, MapPin } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; import { ImageWithFallback } from '../../components/figma/ImageWithFallback'; import globalMapImage from 'figma:asset/1b56e6afe31d5744d2e7a38d3e2f8c3ce78a90af.png'; - +import { useNavigate } from 'react-router-dom'; + const navigate = useNavigate(); // Loading skeleton component for corporate dashboard function CorporateDashboardSkeleton() { return ( @@ -422,7 +422,7 @@ function CorporateAnalytics() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="text-base h-auto p-0 text-primary hover:text-primary/80" > View Reports @@ -506,7 +506,7 @@ function CorporateAnalytics() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="w-full text-base h-11" > View Detailed Analytics @@ -622,7 +622,7 @@ function AssignedTraining() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="text-base h-10" > View All @@ -639,7 +639,7 @@ function AssignedTraining() { className={`group cursor-pointer bg-white rounded-lg border transition-all duration-200 flex flex-col h-full overflow-hidden ${ assignment.status === 'urgent' ? 'border-destructive/30 bg-destructive/5' : 'border-border hover:shadow-md' }`} - onClick={() => navigateTo(`/library?view=corporate&courseId=${assignment.id}&tab=overview`)} + onClick={() => navigate(`/library?view=corporate&courseId=${assignment.id}&tab=overview`)} > {/* Course Image */} @@ -724,7 +724,7 @@ function AssignedTraining() { className="w-full text-base h-10" onClick={(e) => { e.stopPropagation(); - navigateTo(`/library?view=corporate&courseId=${assignment.id}&tab=overview`); + navigate(`/library?view=corporate&courseId=${assignment.id}&tab=overview`); }} > {assignment.status === 'urgent' ? 'Start Now' : 'Begin Training'} @@ -764,7 +764,7 @@ function TeamLeaderboard() { navigateTo('/leaderboard?view=corporate')} + onClick={() => navigate('/leaderboard?view=corporate')} className="text-base h-10 border-2 border-brand-navy/15 text-brand-navy/80 hover:bg-brand-navy/3 font-semibold" > View All diff --git a/src/pages/learner/CourseTimeline.tsx b/src/pages/learner/CourseTimeline.tsx index df1e7cc..273ec14 100644 --- a/src/pages/learner/CourseTimeline.tsx +++ b/src/pages/learner/CourseTimeline.tsx @@ -43,7 +43,8 @@ import { ChevronDown, ChevronUp } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; interface CourseTimelineProps { userType?: 'individual' | 'corporate'; @@ -458,7 +459,7 @@ function CourseHeader({ course }: { course: Course }) { {/* Breadcrumb Navigation */} navigateTo('/dashboard')} + onClick={() => navigate('/dashboard')} className="hover:text-foreground transition-colors active:bg-gray-100 focus:outline-none px-2 py-1 rounded" style={{ outline: 'none' }} > @@ -466,7 +467,7 @@ function CourseHeader({ course }: { course: Course }) { navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-foreground transition-colors active:bg-gray-100 focus:outline-none px-2 py-1 rounded" style={{ outline: 'none' }} > @@ -962,6 +963,8 @@ export function CourseTimeline({ userType = 'individual' }: CourseTimelineProps) const [activeTab, setActiveTab] = useState('overview'); const [course, setCourse] = useState(null); const [isLoading, setIsLoading] = useState(true); + const navigate = useNavigate(); + // Mock user data const user = { @@ -1017,14 +1020,14 @@ export function CourseTimeline({ userType = 'individual' }: CourseTimelineProps) {/* Breadcrumb Navigation */} navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-[#04045B] transition-colors" > Library navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-[#04045B] transition-colors" > Leadership Development diff --git a/src/pages/learner/Dashboard.tsx b/src/pages/learner/Dashboard.tsx index a16064a..230d693 100644 --- a/src/pages/learner/Dashboard.tsx +++ b/src/pages/learner/Dashboard.tsx @@ -75,13 +75,15 @@ import { Monitor, PieChart } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; +// import { navigate } from '../../components/Router'; import { ImageWithFallback } from '../../components/figma/ImageWithFallback'; import CurrentLearningHeaderIcon from '../../imports/CurrentLearningHeaderIcon-4285-106'; import platinumTrophy from 'figma:asset/a224fb6efc954992c535e482fe88d93f1f4178d8.png'; import goldTrophy from 'figma:asset/9ebc01e8eb24f9d71683b2ee63d224583a979590.png'; import silverTrophy from 'figma:asset/9852710543a90e291ecb85d77ea02234139264c5.png'; import bronzeTrophy from 'figma:asset/5fddc261d2e35ee810113f2537c5a59a97fd7fbd.png'; +import { useNavigate } from 'react-router-dom'; + interface DashboardProps { userType?: 'individual' | 'corporate'; @@ -187,7 +189,7 @@ function RecentActivity() { navigateTo('/dashboard?view=individual&tab=activity')} + onClick={() => navigate('/dashboard?view=individual&tab=activity')} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-3 py-1.5 min-h-[48px] font-medium" > View All @@ -806,7 +808,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi {currentCourse.currentModule.title} navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} className="w-full text-base min-h-[48px] bg-brand-gold hover:bg-brand-gold/90 text-brand-charcoal font-medium" > Continue Module → @@ -826,7 +828,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.nextModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.nextModule.number}`)} className="w-full text-base min-h-[48px] border-brand-navy text-brand-navy hover:bg-brand-navy/10 font-medium" > Preview Module → @@ -840,7 +842,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi Course Modules navigateTo(`/course?view=${userType}&courseId=strategic-leadership`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership`)} className="text-sm text-brand-navy hover:text-brand-navy hover:bg-brand-navy/10 p-0 h-auto font-medium" > View All → @@ -875,7 +877,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership`)} className="text-base text-gray-600 hover:text-gray-900 hover:bg-gray-50 p-0 min-h-[48px] font-medium flex items-center gap-1" > @@ -883,7 +885,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} className="text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium px-6" > @@ -990,7 +992,7 @@ function GlobalLeaderboard() { navigateTo('/leaderboard?view=individual')} + onClick={() => navigate('/leaderboard?view=individual')} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-sm px-3 py-1.5 h-auto font-medium" > View All @@ -1111,7 +1113,7 @@ function ActivityRecommendations({ userType = 'individual' }: { userType?: 'indi navigateTo(`/library?view=${userType}`)} + onClick={() => navigate(`/library?view=${userType}`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View All Courses @@ -1160,7 +1162,7 @@ function ActivityRecommendations({ userType = 'individual' }: { userType?: 'indi {/* Enroll Button */} navigateTo(`/course?view=${userType}&courseId=${course.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${course.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > Enroll Now @@ -1243,7 +1245,7 @@ function RecentlyViewed({ userType = 'individual' }: { userType?: 'individual' | navigateTo(`/library?view=${userType}&filter=recent`)} + onClick={() => navigate(`/library?view=${userType}&filter=recent`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View History @@ -1298,7 +1300,7 @@ function RecentlyViewed({ userType = 'individual' }: { userType?: 'individual' | {/* Action Button */} navigateTo(`/course?view=${userType}&courseId=${item.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${item.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > {item.progress === 100 ? 'Review' : item.progress > 0 ? 'Continue' : 'Start'} @@ -1373,7 +1375,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua navigateTo(`/library?view=${userType}&filter=trending`)} + onClick={() => navigate(`/library?view=${userType}&filter=trending`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View Trending @@ -1422,7 +1424,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua {/* Enroll Button */} navigateTo(`/course?view=${userType}&courseId=${content.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${content.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > Enroll Now @@ -1437,6 +1439,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua // Main Dashboard component export default function Dashboard({ userType = 'individual' }: DashboardProps) { + const navigate = useNavigate(); const user = { name: 'Alex', email: 'alex@example.com' }; return ( diff --git a/src/pages/learner/Library.tsx b/src/pages/learner/Library.tsx index 80f0be9..74a2be1 100644 --- a/src/pages/learner/Library.tsx +++ b/src/pages/learner/Library.tsx @@ -10,7 +10,9 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../components/ui/ta import { Skeleton } from '../../components/ui/skeleton'; import { BookOpen, Filter, Search } from 'lucide-react'; import { getCoursesData, Course } from './data/libraryData'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + interface LibraryProps { userType?: 'individual' | 'corporate'; @@ -51,6 +53,7 @@ function LibrarySkeleton() { export function Library({ userType = 'individual' }: LibraryProps) { const [isLoading, setIsLoading] = useState(true); const [courses] = useState(getCoursesData(userType)); + const navigate = useNavigate(); // Filter states const [searchQuery, setSearchQuery] = useState(''); @@ -155,12 +158,12 @@ export function Library({ userType = 'individual' }: LibraryProps) { const handleEnrollCourse = (courseId: string) => { console.log('Enrolling in course:', courseId); - navigateTo(`/course/${courseId}?view=${userType}`); + navigate(`/course/${courseId}?view=${userType}`); }; const handleContinueCourse = (courseId: string) => { console.log('Continuing course:', courseId); - navigateTo(`/course/${courseId}?view=${userType}`); + navigate(`/course/${courseId}?view=${userType}`); }; const handleBookmarkCourse = (courseId: string) => { diff --git a/src/pages/services/Consulting.tsx b/src/pages/services/Consulting.tsx index 8abe34c..6645666 100644 --- a/src/pages/services/Consulting.tsx +++ b/src/pages/services/Consulting.tsx @@ -1,10 +1,11 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; - +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function Consulting() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/CultureCompetence.tsx b/src/pages/services/CultureCompetence.tsx index c9ef980..f455771 100644 --- a/src/pages/services/CultureCompetence.tsx +++ b/src/pages/services/CultureCompetence.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function CultureCompetence() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/ExecutiveCoaching.tsx b/src/pages/services/ExecutiveCoaching.tsx index f2129f4..c0b7e9c 100644 --- a/src/pages/services/ExecutiveCoaching.tsx +++ b/src/pages/services/ExecutiveCoaching.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function ExecutiveCoaching() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/LeadershipDevelopment.tsx b/src/pages/services/LeadershipDevelopment.tsx index 8e28030..c1ae9c6 100644 --- a/src/pages/services/LeadershipDevelopment.tsx +++ b/src/pages/services/LeadershipDevelopment.tsx @@ -1,10 +1,11 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; - +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function LeadershipDevelopment() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/LearningFacility.tsx b/src/pages/services/LearningFacility.tsx index ab8392a..4884376 100644 --- a/src/pages/services/LearningFacility.tsx +++ b/src/pages/services/LearningFacility.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function LearningFacility() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/ManagementDevelopment.tsx b/src/pages/services/ManagementDevelopment.tsx index efae245..4840d6f 100644 --- a/src/pages/services/ManagementDevelopment.tsx +++ b/src/pages/services/ManagementDevelopment.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function ManagementDevelopment() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null;
Don't have an account?{' '} navigateTo('/signup')} + onClick={() => navigate('/signup')} className="text-primary hover:text-primary/80 font-medium" > Create one here diff --git a/src/pages/LoginSelection.tsx b/src/pages/LoginSelection.tsx index 802bccb..2f85860 100644 --- a/src/pages/LoginSelection.tsx +++ b/src/pages/LoginSelection.tsx @@ -3,31 +3,32 @@ import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { Badge } from '../components/ui/badge'; import { ArrowLeft, Building2, User, ArrowRight, CheckCircle, Users, Target, BookOpen, Video, Award, BarChart3 } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +// const navigate = useNavigate(); import { useAuth } from '../components/AuthContext'; - +import { useNavigate } from 'react-router-dom'; + const navigate = useNavigate(); export function LoginSelection() { const { login } = useAuth(); const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; const handleIndividualLogin = () => { // Direct navigation to individual dashboard login('demo@klc.edu', 'demo').then(() => { - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); }).catch(() => { - navigateTo('/dashboard?view=individual'); + navigate('/dashboard?view=individual'); }); }; const handleCorporateLogin = () => { // Direct navigation to corporate dashboard login('corporate@klc.edu', 'demo').then(() => { - navigateTo('/dashboard?view=corporate'); + navigate('/dashboard?view=corporate'); }).catch(() => { - navigateTo('/dashboard?view=corporate'); + navigate('/dashboard?view=corporate'); }); }; @@ -145,7 +146,7 @@ export function LoginSelection() { Want to explore first?{' '} navigateTo('/login')} + onClick={() => navigate('/login')} className="text-blue-600 hover:text-blue-700 font-medium hover:underline" > View login options @@ -237,7 +238,7 @@ export function LoginSelection() { Want to explore first?{' '} navigateTo('/corporate/login')} + onClick={() => navigate('/corporate/login')} className="text-purple-600 hover:text-purple-700 font-medium hover:underline" > View login options @@ -285,14 +286,14 @@ export function LoginSelection() { navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[16px] min-h-[44px] border-[#04045B] text-[#04045B] hover:bg-[#04045B]/10" > Contact Support navigateTo('/individual-webinars')} + onClick={() => navigate('/individual-webinars')} className="text-[16px] min-h-[44px] border-[#04045B] text-[#04045B] hover:bg-[#04045B]/10" > Explore Learning Resources diff --git a/src/pages/MyCohort.tsx b/src/pages/MyCohort.tsx index cf0eb25..0613ebc 100644 --- a/src/pages/MyCohort.tsx +++ b/src/pages/MyCohort.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function MyCohort() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/NotFound.tsx b/src/pages/NotFound.tsx index 32f2c61..4964d76 100644 --- a/src/pages/NotFound.tsx +++ b/src/pages/NotFound.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent } from '../components/ui/card'; import { ArrowLeft, Home, Search, HelpCircle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function NotFound() { const handleGoHome = () => { - navigateTo('/'); + navigate('/'); }; const handleGoBack = () => { @@ -56,7 +56,7 @@ export function NotFound() { navigateTo('/individual-webinars')} + onClick={() => navigate('/individual-webinars')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -64,7 +64,7 @@ export function NotFound() { navigateTo('/contact')} + onClick={() => navigate('/contact')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -72,7 +72,7 @@ export function NotFound() { navigateTo('/auth')} + onClick={() => navigate('/auth')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -86,7 +86,7 @@ export function NotFound() { Still need help? Contact our{' '} navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[#04045B] hover:text-[#04045B]/80 font-medium" > support team diff --git a/src/pages/OrderConfirmation.tsx b/src/pages/OrderConfirmation.tsx index 0e67198..394deb9 100644 --- a/src/pages/OrderConfirmation.tsx +++ b/src/pages/OrderConfirmation.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OrderConfirmation() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OrderFailed.tsx b/src/pages/OrderFailed.tsx index 26f5ad5..5b94f4a 100644 --- a/src/pages/OrderFailed.tsx +++ b/src/pages/OrderFailed.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OrderFailed() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurExpertise.tsx b/src/pages/OurExpertise.tsx index 3b0fd83..6846d5d 100644 --- a/src/pages/OurExpertise.tsx +++ b/src/pages/OurExpertise.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurExpertise() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurImpact.tsx b/src/pages/OurImpact.tsx index dfce49f..768283b 100644 --- a/src/pages/OurImpact.tsx +++ b/src/pages/OurImpact.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurImpact() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurTeam.tsx b/src/pages/OurTeam.tsx index c2f6441..fe0c72f 100644 --- a/src/pages/OurTeam.tsx +++ b/src/pages/OurTeam.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurTeam() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurVision.tsx b/src/pages/OurVision.tsx index 570a9af..9a45c0a 100644 --- a/src/pages/OurVision.tsx +++ b/src/pages/OurVision.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurVision() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Privacy.tsx b/src/pages/Privacy.tsx index 66bee11..992227d 100644 --- a/src/pages/Privacy.tsx +++ b/src/pages/Privacy.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Shield, Eye, Lock, FileText } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Privacy() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( diff --git a/src/pages/ProgrammeCatalogue.tsx b/src/pages/ProgrammeCatalogue.tsx index 7fe4c2b..0a44590 100644 --- a/src/pages/ProgrammeCatalogue.tsx +++ b/src/pages/ProgrammeCatalogue.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ProgrammeCatalogue() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/ProgrammeDetail.tsx b/src/pages/ProgrammeDetail.tsx index f9a5ad3..eb92efb 100644 --- a/src/pages/ProgrammeDetail.tsx +++ b/src/pages/ProgrammeDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ProgrammeDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Resources.tsx b/src/pages/Resources.tsx index 4c7267d..a433272 100644 --- a/src/pages/Resources.tsx +++ b/src/pages/Resources.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Resources() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index 363c567..482c52c 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -56,13 +56,15 @@ import { HelpCircle, ExternalLink } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +import { useNavigate } from 'react-router-dom'; interface SettingsProps { userType?: 'individual' | 'corporate'; } export function Settings({ userType: propUserType }: SettingsProps) { + + const navigate = useNavigate(); // Enhanced user type detection with multiple fallbacks const getQueryParam = (param: string) => { const urlParams = new URLSearchParams(window.location.search); @@ -1169,7 +1171,7 @@ export function Settings({ userType: propUserType }: SettingsProps) { navigateTo('/privacy')} + onClick={() => navigate('/privacy')} className="text-base min-h-[44px]" > diff --git a/src/pages/Signup.tsx b/src/pages/Signup.tsx index fe255b8..824f37e 100644 --- a/src/pages/Signup.tsx +++ b/src/pages/Signup.tsx @@ -3,7 +3,7 @@ import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Eye, EyeOff, Mail, Lock, User } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Signup() { const [formData, setFormData] = useState({ @@ -24,7 +24,7 @@ export function Signup() { try { // Simulate signup await new Promise(resolve => setTimeout(resolve, 1000)); - navigateTo('/email-verification'); + navigate('/email-verification'); } catch (error) { console.error('Signup failed:', error); } finally { @@ -33,7 +33,7 @@ export function Signup() { }; const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( @@ -195,7 +195,7 @@ export function Signup() { I agree to the{' '} navigateTo('/terms')} + onClick={() => navigate('/terms')} className="text-primary hover:text-primary/80 font-medium" > Terms of Service @@ -203,7 +203,7 @@ export function Signup() { {' '}and{' '} navigateTo('/privacy')} + onClick={() => navigate('/privacy')} className="text-primary hover:text-primary/80 font-medium" > Privacy Policy @@ -224,7 +224,7 @@ export function Signup() { Already have an account?{' '} navigateTo('/auth')} + onClick={() => navigate('/auth')} className="text-primary hover:text-primary/80 font-medium" > Sign in here diff --git a/src/pages/Surveys.tsx b/src/pages/Surveys.tsx index 0c5dcbb..fc3933b 100644 --- a/src/pages/Surveys.tsx +++ b/src/pages/Surveys.tsx @@ -39,9 +39,9 @@ import { Globe, ExternalLink } from 'lucide-react'; -import { navigateTo } from '../components/Router'; import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, PieChart, Pie, Cell } from 'recharts'; import exampleImage from 'figma:asset/c501c3d3f3a828828d4cb2dadb9558b43986718f.png'; +import { useNavigate } from 'react-router-dom'; interface SurveyProps { userType: 'individual' | 'corporate'; @@ -380,6 +380,7 @@ function SurveyCard({ export function Surveys({ userType = 'individual' }: SurveyProps) { const [activeTab, setActiveTab] = useState<'available' | 'completed'>('available'); + const navigate = useNavigate(); // Mock user data for LearnerLayout - matching Library page pattern const user = { diff --git a/src/pages/TeamLeadership.tsx b/src/pages/TeamLeadership.tsx index 8ea2ec3..20f9759 100644 --- a/src/pages/TeamLeadership.tsx +++ b/src/pages/TeamLeadership.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function TeamLeadership() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Terms.tsx b/src/pages/Terms.tsx index 88e82fc..dba47ba 100644 --- a/src/pages/Terms.tsx +++ b/src/pages/Terms.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, FileText, Scale, AlertCircle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Terms() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( diff --git a/src/pages/WebinarDetail.tsx b/src/pages/WebinarDetail.tsx index 78af510..d8fff7d 100644 --- a/src/pages/WebinarDetail.tsx +++ b/src/pages/WebinarDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function WebinarDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/WebinarListing.tsx b/src/pages/WebinarListing.tsx index 9718450..f5e8526 100644 --- a/src/pages/WebinarListing.tsx +++ b/src/pages/WebinarListing.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function WebinarListing() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/learner/CorporateDashboard.tsx b/src/pages/learner/CorporateDashboard.tsx index f4fb94f..8e0109f 100644 --- a/src/pages/learner/CorporateDashboard.tsx +++ b/src/pages/learner/CorporateDashboard.tsx @@ -46,10 +46,10 @@ import { Globe, MapPin } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; import { ImageWithFallback } from '../../components/figma/ImageWithFallback'; import globalMapImage from 'figma:asset/1b56e6afe31d5744d2e7a38d3e2f8c3ce78a90af.png'; - +import { useNavigate } from 'react-router-dom'; + const navigate = useNavigate(); // Loading skeleton component for corporate dashboard function CorporateDashboardSkeleton() { return ( @@ -422,7 +422,7 @@ function CorporateAnalytics() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="text-base h-auto p-0 text-primary hover:text-primary/80" > View Reports @@ -506,7 +506,7 @@ function CorporateAnalytics() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="w-full text-base h-11" > View Detailed Analytics @@ -622,7 +622,7 @@ function AssignedTraining() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="text-base h-10" > View All @@ -639,7 +639,7 @@ function AssignedTraining() { className={`group cursor-pointer bg-white rounded-lg border transition-all duration-200 flex flex-col h-full overflow-hidden ${ assignment.status === 'urgent' ? 'border-destructive/30 bg-destructive/5' : 'border-border hover:shadow-md' }`} - onClick={() => navigateTo(`/library?view=corporate&courseId=${assignment.id}&tab=overview`)} + onClick={() => navigate(`/library?view=corporate&courseId=${assignment.id}&tab=overview`)} > {/* Course Image */} @@ -724,7 +724,7 @@ function AssignedTraining() { className="w-full text-base h-10" onClick={(e) => { e.stopPropagation(); - navigateTo(`/library?view=corporate&courseId=${assignment.id}&tab=overview`); + navigate(`/library?view=corporate&courseId=${assignment.id}&tab=overview`); }} > {assignment.status === 'urgent' ? 'Start Now' : 'Begin Training'} @@ -764,7 +764,7 @@ function TeamLeaderboard() { navigateTo('/leaderboard?view=corporate')} + onClick={() => navigate('/leaderboard?view=corporate')} className="text-base h-10 border-2 border-brand-navy/15 text-brand-navy/80 hover:bg-brand-navy/3 font-semibold" > View All diff --git a/src/pages/learner/CourseTimeline.tsx b/src/pages/learner/CourseTimeline.tsx index df1e7cc..273ec14 100644 --- a/src/pages/learner/CourseTimeline.tsx +++ b/src/pages/learner/CourseTimeline.tsx @@ -43,7 +43,8 @@ import { ChevronDown, ChevronUp } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; interface CourseTimelineProps { userType?: 'individual' | 'corporate'; @@ -458,7 +459,7 @@ function CourseHeader({ course }: { course: Course }) { {/* Breadcrumb Navigation */} navigateTo('/dashboard')} + onClick={() => navigate('/dashboard')} className="hover:text-foreground transition-colors active:bg-gray-100 focus:outline-none px-2 py-1 rounded" style={{ outline: 'none' }} > @@ -466,7 +467,7 @@ function CourseHeader({ course }: { course: Course }) { navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-foreground transition-colors active:bg-gray-100 focus:outline-none px-2 py-1 rounded" style={{ outline: 'none' }} > @@ -962,6 +963,8 @@ export function CourseTimeline({ userType = 'individual' }: CourseTimelineProps) const [activeTab, setActiveTab] = useState('overview'); const [course, setCourse] = useState(null); const [isLoading, setIsLoading] = useState(true); + const navigate = useNavigate(); + // Mock user data const user = { @@ -1017,14 +1020,14 @@ export function CourseTimeline({ userType = 'individual' }: CourseTimelineProps) {/* Breadcrumb Navigation */} navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-[#04045B] transition-colors" > Library navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-[#04045B] transition-colors" > Leadership Development diff --git a/src/pages/learner/Dashboard.tsx b/src/pages/learner/Dashboard.tsx index a16064a..230d693 100644 --- a/src/pages/learner/Dashboard.tsx +++ b/src/pages/learner/Dashboard.tsx @@ -75,13 +75,15 @@ import { Monitor, PieChart } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; +// import { navigate } from '../../components/Router'; import { ImageWithFallback } from '../../components/figma/ImageWithFallback'; import CurrentLearningHeaderIcon from '../../imports/CurrentLearningHeaderIcon-4285-106'; import platinumTrophy from 'figma:asset/a224fb6efc954992c535e482fe88d93f1f4178d8.png'; import goldTrophy from 'figma:asset/9ebc01e8eb24f9d71683b2ee63d224583a979590.png'; import silverTrophy from 'figma:asset/9852710543a90e291ecb85d77ea02234139264c5.png'; import bronzeTrophy from 'figma:asset/5fddc261d2e35ee810113f2537c5a59a97fd7fbd.png'; +import { useNavigate } from 'react-router-dom'; + interface DashboardProps { userType?: 'individual' | 'corporate'; @@ -187,7 +189,7 @@ function RecentActivity() { navigateTo('/dashboard?view=individual&tab=activity')} + onClick={() => navigate('/dashboard?view=individual&tab=activity')} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-3 py-1.5 min-h-[48px] font-medium" > View All @@ -806,7 +808,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi {currentCourse.currentModule.title} navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} className="w-full text-base min-h-[48px] bg-brand-gold hover:bg-brand-gold/90 text-brand-charcoal font-medium" > Continue Module → @@ -826,7 +828,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.nextModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.nextModule.number}`)} className="w-full text-base min-h-[48px] border-brand-navy text-brand-navy hover:bg-brand-navy/10 font-medium" > Preview Module → @@ -840,7 +842,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi Course Modules navigateTo(`/course?view=${userType}&courseId=strategic-leadership`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership`)} className="text-sm text-brand-navy hover:text-brand-navy hover:bg-brand-navy/10 p-0 h-auto font-medium" > View All → @@ -875,7 +877,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership`)} className="text-base text-gray-600 hover:text-gray-900 hover:bg-gray-50 p-0 min-h-[48px] font-medium flex items-center gap-1" > @@ -883,7 +885,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} className="text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium px-6" > @@ -990,7 +992,7 @@ function GlobalLeaderboard() { navigateTo('/leaderboard?view=individual')} + onClick={() => navigate('/leaderboard?view=individual')} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-sm px-3 py-1.5 h-auto font-medium" > View All @@ -1111,7 +1113,7 @@ function ActivityRecommendations({ userType = 'individual' }: { userType?: 'indi navigateTo(`/library?view=${userType}`)} + onClick={() => navigate(`/library?view=${userType}`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View All Courses @@ -1160,7 +1162,7 @@ function ActivityRecommendations({ userType = 'individual' }: { userType?: 'indi {/* Enroll Button */} navigateTo(`/course?view=${userType}&courseId=${course.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${course.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > Enroll Now @@ -1243,7 +1245,7 @@ function RecentlyViewed({ userType = 'individual' }: { userType?: 'individual' | navigateTo(`/library?view=${userType}&filter=recent`)} + onClick={() => navigate(`/library?view=${userType}&filter=recent`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View History @@ -1298,7 +1300,7 @@ function RecentlyViewed({ userType = 'individual' }: { userType?: 'individual' | {/* Action Button */} navigateTo(`/course?view=${userType}&courseId=${item.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${item.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > {item.progress === 100 ? 'Review' : item.progress > 0 ? 'Continue' : 'Start'} @@ -1373,7 +1375,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua navigateTo(`/library?view=${userType}&filter=trending`)} + onClick={() => navigate(`/library?view=${userType}&filter=trending`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View Trending @@ -1422,7 +1424,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua {/* Enroll Button */} navigateTo(`/course?view=${userType}&courseId=${content.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${content.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > Enroll Now @@ -1437,6 +1439,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua // Main Dashboard component export default function Dashboard({ userType = 'individual' }: DashboardProps) { + const navigate = useNavigate(); const user = { name: 'Alex', email: 'alex@example.com' }; return ( diff --git a/src/pages/learner/Library.tsx b/src/pages/learner/Library.tsx index 80f0be9..74a2be1 100644 --- a/src/pages/learner/Library.tsx +++ b/src/pages/learner/Library.tsx @@ -10,7 +10,9 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../components/ui/ta import { Skeleton } from '../../components/ui/skeleton'; import { BookOpen, Filter, Search } from 'lucide-react'; import { getCoursesData, Course } from './data/libraryData'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + interface LibraryProps { userType?: 'individual' | 'corporate'; @@ -51,6 +53,7 @@ function LibrarySkeleton() { export function Library({ userType = 'individual' }: LibraryProps) { const [isLoading, setIsLoading] = useState(true); const [courses] = useState(getCoursesData(userType)); + const navigate = useNavigate(); // Filter states const [searchQuery, setSearchQuery] = useState(''); @@ -155,12 +158,12 @@ export function Library({ userType = 'individual' }: LibraryProps) { const handleEnrollCourse = (courseId: string) => { console.log('Enrolling in course:', courseId); - navigateTo(`/course/${courseId}?view=${userType}`); + navigate(`/course/${courseId}?view=${userType}`); }; const handleContinueCourse = (courseId: string) => { console.log('Continuing course:', courseId); - navigateTo(`/course/${courseId}?view=${userType}`); + navigate(`/course/${courseId}?view=${userType}`); }; const handleBookmarkCourse = (courseId: string) => { diff --git a/src/pages/services/Consulting.tsx b/src/pages/services/Consulting.tsx index 8abe34c..6645666 100644 --- a/src/pages/services/Consulting.tsx +++ b/src/pages/services/Consulting.tsx @@ -1,10 +1,11 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; - +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function Consulting() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/CultureCompetence.tsx b/src/pages/services/CultureCompetence.tsx index c9ef980..f455771 100644 --- a/src/pages/services/CultureCompetence.tsx +++ b/src/pages/services/CultureCompetence.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function CultureCompetence() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/ExecutiveCoaching.tsx b/src/pages/services/ExecutiveCoaching.tsx index f2129f4..c0b7e9c 100644 --- a/src/pages/services/ExecutiveCoaching.tsx +++ b/src/pages/services/ExecutiveCoaching.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function ExecutiveCoaching() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/LeadershipDevelopment.tsx b/src/pages/services/LeadershipDevelopment.tsx index 8e28030..c1ae9c6 100644 --- a/src/pages/services/LeadershipDevelopment.tsx +++ b/src/pages/services/LeadershipDevelopment.tsx @@ -1,10 +1,11 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; - +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function LeadershipDevelopment() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/LearningFacility.tsx b/src/pages/services/LearningFacility.tsx index ab8392a..4884376 100644 --- a/src/pages/services/LearningFacility.tsx +++ b/src/pages/services/LearningFacility.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function LearningFacility() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/ManagementDevelopment.tsx b/src/pages/services/ManagementDevelopment.tsx index efae245..4840d6f 100644 --- a/src/pages/services/ManagementDevelopment.tsx +++ b/src/pages/services/ManagementDevelopment.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function ManagementDevelopment() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null;
Want to explore first?{' '} navigateTo('/login')} + onClick={() => navigate('/login')} className="text-blue-600 hover:text-blue-700 font-medium hover:underline" > View login options @@ -237,7 +238,7 @@ export function LoginSelection() { Want to explore first?{' '} navigateTo('/corporate/login')} + onClick={() => navigate('/corporate/login')} className="text-purple-600 hover:text-purple-700 font-medium hover:underline" > View login options @@ -285,14 +286,14 @@ export function LoginSelection() { navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[16px] min-h-[44px] border-[#04045B] text-[#04045B] hover:bg-[#04045B]/10" > Contact Support navigateTo('/individual-webinars')} + onClick={() => navigate('/individual-webinars')} className="text-[16px] min-h-[44px] border-[#04045B] text-[#04045B] hover:bg-[#04045B]/10" > Explore Learning Resources diff --git a/src/pages/MyCohort.tsx b/src/pages/MyCohort.tsx index cf0eb25..0613ebc 100644 --- a/src/pages/MyCohort.tsx +++ b/src/pages/MyCohort.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function MyCohort() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/NotFound.tsx b/src/pages/NotFound.tsx index 32f2c61..4964d76 100644 --- a/src/pages/NotFound.tsx +++ b/src/pages/NotFound.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent } from '../components/ui/card'; import { ArrowLeft, Home, Search, HelpCircle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function NotFound() { const handleGoHome = () => { - navigateTo('/'); + navigate('/'); }; const handleGoBack = () => { @@ -56,7 +56,7 @@ export function NotFound() { navigateTo('/individual-webinars')} + onClick={() => navigate('/individual-webinars')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -64,7 +64,7 @@ export function NotFound() { navigateTo('/contact')} + onClick={() => navigate('/contact')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -72,7 +72,7 @@ export function NotFound() { navigateTo('/auth')} + onClick={() => navigate('/auth')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -86,7 +86,7 @@ export function NotFound() { Still need help? Contact our{' '} navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[#04045B] hover:text-[#04045B]/80 font-medium" > support team diff --git a/src/pages/OrderConfirmation.tsx b/src/pages/OrderConfirmation.tsx index 0e67198..394deb9 100644 --- a/src/pages/OrderConfirmation.tsx +++ b/src/pages/OrderConfirmation.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OrderConfirmation() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OrderFailed.tsx b/src/pages/OrderFailed.tsx index 26f5ad5..5b94f4a 100644 --- a/src/pages/OrderFailed.tsx +++ b/src/pages/OrderFailed.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OrderFailed() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurExpertise.tsx b/src/pages/OurExpertise.tsx index 3b0fd83..6846d5d 100644 --- a/src/pages/OurExpertise.tsx +++ b/src/pages/OurExpertise.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurExpertise() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurImpact.tsx b/src/pages/OurImpact.tsx index dfce49f..768283b 100644 --- a/src/pages/OurImpact.tsx +++ b/src/pages/OurImpact.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurImpact() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurTeam.tsx b/src/pages/OurTeam.tsx index c2f6441..fe0c72f 100644 --- a/src/pages/OurTeam.tsx +++ b/src/pages/OurTeam.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurTeam() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurVision.tsx b/src/pages/OurVision.tsx index 570a9af..9a45c0a 100644 --- a/src/pages/OurVision.tsx +++ b/src/pages/OurVision.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurVision() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Privacy.tsx b/src/pages/Privacy.tsx index 66bee11..992227d 100644 --- a/src/pages/Privacy.tsx +++ b/src/pages/Privacy.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Shield, Eye, Lock, FileText } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Privacy() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( diff --git a/src/pages/ProgrammeCatalogue.tsx b/src/pages/ProgrammeCatalogue.tsx index 7fe4c2b..0a44590 100644 --- a/src/pages/ProgrammeCatalogue.tsx +++ b/src/pages/ProgrammeCatalogue.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ProgrammeCatalogue() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/ProgrammeDetail.tsx b/src/pages/ProgrammeDetail.tsx index f9a5ad3..eb92efb 100644 --- a/src/pages/ProgrammeDetail.tsx +++ b/src/pages/ProgrammeDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ProgrammeDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Resources.tsx b/src/pages/Resources.tsx index 4c7267d..a433272 100644 --- a/src/pages/Resources.tsx +++ b/src/pages/Resources.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Resources() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index 363c567..482c52c 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -56,13 +56,15 @@ import { HelpCircle, ExternalLink } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +import { useNavigate } from 'react-router-dom'; interface SettingsProps { userType?: 'individual' | 'corporate'; } export function Settings({ userType: propUserType }: SettingsProps) { + + const navigate = useNavigate(); // Enhanced user type detection with multiple fallbacks const getQueryParam = (param: string) => { const urlParams = new URLSearchParams(window.location.search); @@ -1169,7 +1171,7 @@ export function Settings({ userType: propUserType }: SettingsProps) { navigateTo('/privacy')} + onClick={() => navigate('/privacy')} className="text-base min-h-[44px]" > diff --git a/src/pages/Signup.tsx b/src/pages/Signup.tsx index fe255b8..824f37e 100644 --- a/src/pages/Signup.tsx +++ b/src/pages/Signup.tsx @@ -3,7 +3,7 @@ import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Eye, EyeOff, Mail, Lock, User } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Signup() { const [formData, setFormData] = useState({ @@ -24,7 +24,7 @@ export function Signup() { try { // Simulate signup await new Promise(resolve => setTimeout(resolve, 1000)); - navigateTo('/email-verification'); + navigate('/email-verification'); } catch (error) { console.error('Signup failed:', error); } finally { @@ -33,7 +33,7 @@ export function Signup() { }; const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( @@ -195,7 +195,7 @@ export function Signup() { I agree to the{' '} navigateTo('/terms')} + onClick={() => navigate('/terms')} className="text-primary hover:text-primary/80 font-medium" > Terms of Service @@ -203,7 +203,7 @@ export function Signup() { {' '}and{' '} navigateTo('/privacy')} + onClick={() => navigate('/privacy')} className="text-primary hover:text-primary/80 font-medium" > Privacy Policy @@ -224,7 +224,7 @@ export function Signup() { Already have an account?{' '} navigateTo('/auth')} + onClick={() => navigate('/auth')} className="text-primary hover:text-primary/80 font-medium" > Sign in here diff --git a/src/pages/Surveys.tsx b/src/pages/Surveys.tsx index 0c5dcbb..fc3933b 100644 --- a/src/pages/Surveys.tsx +++ b/src/pages/Surveys.tsx @@ -39,9 +39,9 @@ import { Globe, ExternalLink } from 'lucide-react'; -import { navigateTo } from '../components/Router'; import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, PieChart, Pie, Cell } from 'recharts'; import exampleImage from 'figma:asset/c501c3d3f3a828828d4cb2dadb9558b43986718f.png'; +import { useNavigate } from 'react-router-dom'; interface SurveyProps { userType: 'individual' | 'corporate'; @@ -380,6 +380,7 @@ function SurveyCard({ export function Surveys({ userType = 'individual' }: SurveyProps) { const [activeTab, setActiveTab] = useState<'available' | 'completed'>('available'); + const navigate = useNavigate(); // Mock user data for LearnerLayout - matching Library page pattern const user = { diff --git a/src/pages/TeamLeadership.tsx b/src/pages/TeamLeadership.tsx index 8ea2ec3..20f9759 100644 --- a/src/pages/TeamLeadership.tsx +++ b/src/pages/TeamLeadership.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function TeamLeadership() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Terms.tsx b/src/pages/Terms.tsx index 88e82fc..dba47ba 100644 --- a/src/pages/Terms.tsx +++ b/src/pages/Terms.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, FileText, Scale, AlertCircle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Terms() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( diff --git a/src/pages/WebinarDetail.tsx b/src/pages/WebinarDetail.tsx index 78af510..d8fff7d 100644 --- a/src/pages/WebinarDetail.tsx +++ b/src/pages/WebinarDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function WebinarDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/WebinarListing.tsx b/src/pages/WebinarListing.tsx index 9718450..f5e8526 100644 --- a/src/pages/WebinarListing.tsx +++ b/src/pages/WebinarListing.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function WebinarListing() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/learner/CorporateDashboard.tsx b/src/pages/learner/CorporateDashboard.tsx index f4fb94f..8e0109f 100644 --- a/src/pages/learner/CorporateDashboard.tsx +++ b/src/pages/learner/CorporateDashboard.tsx @@ -46,10 +46,10 @@ import { Globe, MapPin } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; import { ImageWithFallback } from '../../components/figma/ImageWithFallback'; import globalMapImage from 'figma:asset/1b56e6afe31d5744d2e7a38d3e2f8c3ce78a90af.png'; - +import { useNavigate } from 'react-router-dom'; + const navigate = useNavigate(); // Loading skeleton component for corporate dashboard function CorporateDashboardSkeleton() { return ( @@ -422,7 +422,7 @@ function CorporateAnalytics() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="text-base h-auto p-0 text-primary hover:text-primary/80" > View Reports @@ -506,7 +506,7 @@ function CorporateAnalytics() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="w-full text-base h-11" > View Detailed Analytics @@ -622,7 +622,7 @@ function AssignedTraining() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="text-base h-10" > View All @@ -639,7 +639,7 @@ function AssignedTraining() { className={`group cursor-pointer bg-white rounded-lg border transition-all duration-200 flex flex-col h-full overflow-hidden ${ assignment.status === 'urgent' ? 'border-destructive/30 bg-destructive/5' : 'border-border hover:shadow-md' }`} - onClick={() => navigateTo(`/library?view=corporate&courseId=${assignment.id}&tab=overview`)} + onClick={() => navigate(`/library?view=corporate&courseId=${assignment.id}&tab=overview`)} > {/* Course Image */} @@ -724,7 +724,7 @@ function AssignedTraining() { className="w-full text-base h-10" onClick={(e) => { e.stopPropagation(); - navigateTo(`/library?view=corporate&courseId=${assignment.id}&tab=overview`); + navigate(`/library?view=corporate&courseId=${assignment.id}&tab=overview`); }} > {assignment.status === 'urgent' ? 'Start Now' : 'Begin Training'} @@ -764,7 +764,7 @@ function TeamLeaderboard() { navigateTo('/leaderboard?view=corporate')} + onClick={() => navigate('/leaderboard?view=corporate')} className="text-base h-10 border-2 border-brand-navy/15 text-brand-navy/80 hover:bg-brand-navy/3 font-semibold" > View All diff --git a/src/pages/learner/CourseTimeline.tsx b/src/pages/learner/CourseTimeline.tsx index df1e7cc..273ec14 100644 --- a/src/pages/learner/CourseTimeline.tsx +++ b/src/pages/learner/CourseTimeline.tsx @@ -43,7 +43,8 @@ import { ChevronDown, ChevronUp } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; interface CourseTimelineProps { userType?: 'individual' | 'corporate'; @@ -458,7 +459,7 @@ function CourseHeader({ course }: { course: Course }) { {/* Breadcrumb Navigation */} navigateTo('/dashboard')} + onClick={() => navigate('/dashboard')} className="hover:text-foreground transition-colors active:bg-gray-100 focus:outline-none px-2 py-1 rounded" style={{ outline: 'none' }} > @@ -466,7 +467,7 @@ function CourseHeader({ course }: { course: Course }) { navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-foreground transition-colors active:bg-gray-100 focus:outline-none px-2 py-1 rounded" style={{ outline: 'none' }} > @@ -962,6 +963,8 @@ export function CourseTimeline({ userType = 'individual' }: CourseTimelineProps) const [activeTab, setActiveTab] = useState('overview'); const [course, setCourse] = useState(null); const [isLoading, setIsLoading] = useState(true); + const navigate = useNavigate(); + // Mock user data const user = { @@ -1017,14 +1020,14 @@ export function CourseTimeline({ userType = 'individual' }: CourseTimelineProps) {/* Breadcrumb Navigation */} navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-[#04045B] transition-colors" > Library navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-[#04045B] transition-colors" > Leadership Development diff --git a/src/pages/learner/Dashboard.tsx b/src/pages/learner/Dashboard.tsx index a16064a..230d693 100644 --- a/src/pages/learner/Dashboard.tsx +++ b/src/pages/learner/Dashboard.tsx @@ -75,13 +75,15 @@ import { Monitor, PieChart } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; +// import { navigate } from '../../components/Router'; import { ImageWithFallback } from '../../components/figma/ImageWithFallback'; import CurrentLearningHeaderIcon from '../../imports/CurrentLearningHeaderIcon-4285-106'; import platinumTrophy from 'figma:asset/a224fb6efc954992c535e482fe88d93f1f4178d8.png'; import goldTrophy from 'figma:asset/9ebc01e8eb24f9d71683b2ee63d224583a979590.png'; import silverTrophy from 'figma:asset/9852710543a90e291ecb85d77ea02234139264c5.png'; import bronzeTrophy from 'figma:asset/5fddc261d2e35ee810113f2537c5a59a97fd7fbd.png'; +import { useNavigate } from 'react-router-dom'; + interface DashboardProps { userType?: 'individual' | 'corporate'; @@ -187,7 +189,7 @@ function RecentActivity() { navigateTo('/dashboard?view=individual&tab=activity')} + onClick={() => navigate('/dashboard?view=individual&tab=activity')} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-3 py-1.5 min-h-[48px] font-medium" > View All @@ -806,7 +808,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi {currentCourse.currentModule.title} navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} className="w-full text-base min-h-[48px] bg-brand-gold hover:bg-brand-gold/90 text-brand-charcoal font-medium" > Continue Module → @@ -826,7 +828,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.nextModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.nextModule.number}`)} className="w-full text-base min-h-[48px] border-brand-navy text-brand-navy hover:bg-brand-navy/10 font-medium" > Preview Module → @@ -840,7 +842,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi Course Modules navigateTo(`/course?view=${userType}&courseId=strategic-leadership`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership`)} className="text-sm text-brand-navy hover:text-brand-navy hover:bg-brand-navy/10 p-0 h-auto font-medium" > View All → @@ -875,7 +877,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership`)} className="text-base text-gray-600 hover:text-gray-900 hover:bg-gray-50 p-0 min-h-[48px] font-medium flex items-center gap-1" > @@ -883,7 +885,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} className="text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium px-6" > @@ -990,7 +992,7 @@ function GlobalLeaderboard() { navigateTo('/leaderboard?view=individual')} + onClick={() => navigate('/leaderboard?view=individual')} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-sm px-3 py-1.5 h-auto font-medium" > View All @@ -1111,7 +1113,7 @@ function ActivityRecommendations({ userType = 'individual' }: { userType?: 'indi navigateTo(`/library?view=${userType}`)} + onClick={() => navigate(`/library?view=${userType}`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View All Courses @@ -1160,7 +1162,7 @@ function ActivityRecommendations({ userType = 'individual' }: { userType?: 'indi {/* Enroll Button */} navigateTo(`/course?view=${userType}&courseId=${course.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${course.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > Enroll Now @@ -1243,7 +1245,7 @@ function RecentlyViewed({ userType = 'individual' }: { userType?: 'individual' | navigateTo(`/library?view=${userType}&filter=recent`)} + onClick={() => navigate(`/library?view=${userType}&filter=recent`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View History @@ -1298,7 +1300,7 @@ function RecentlyViewed({ userType = 'individual' }: { userType?: 'individual' | {/* Action Button */} navigateTo(`/course?view=${userType}&courseId=${item.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${item.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > {item.progress === 100 ? 'Review' : item.progress > 0 ? 'Continue' : 'Start'} @@ -1373,7 +1375,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua navigateTo(`/library?view=${userType}&filter=trending`)} + onClick={() => navigate(`/library?view=${userType}&filter=trending`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View Trending @@ -1422,7 +1424,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua {/* Enroll Button */} navigateTo(`/course?view=${userType}&courseId=${content.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${content.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > Enroll Now @@ -1437,6 +1439,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua // Main Dashboard component export default function Dashboard({ userType = 'individual' }: DashboardProps) { + const navigate = useNavigate(); const user = { name: 'Alex', email: 'alex@example.com' }; return ( diff --git a/src/pages/learner/Library.tsx b/src/pages/learner/Library.tsx index 80f0be9..74a2be1 100644 --- a/src/pages/learner/Library.tsx +++ b/src/pages/learner/Library.tsx @@ -10,7 +10,9 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../components/ui/ta import { Skeleton } from '../../components/ui/skeleton'; import { BookOpen, Filter, Search } from 'lucide-react'; import { getCoursesData, Course } from './data/libraryData'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + interface LibraryProps { userType?: 'individual' | 'corporate'; @@ -51,6 +53,7 @@ function LibrarySkeleton() { export function Library({ userType = 'individual' }: LibraryProps) { const [isLoading, setIsLoading] = useState(true); const [courses] = useState(getCoursesData(userType)); + const navigate = useNavigate(); // Filter states const [searchQuery, setSearchQuery] = useState(''); @@ -155,12 +158,12 @@ export function Library({ userType = 'individual' }: LibraryProps) { const handleEnrollCourse = (courseId: string) => { console.log('Enrolling in course:', courseId); - navigateTo(`/course/${courseId}?view=${userType}`); + navigate(`/course/${courseId}?view=${userType}`); }; const handleContinueCourse = (courseId: string) => { console.log('Continuing course:', courseId); - navigateTo(`/course/${courseId}?view=${userType}`); + navigate(`/course/${courseId}?view=${userType}`); }; const handleBookmarkCourse = (courseId: string) => { diff --git a/src/pages/services/Consulting.tsx b/src/pages/services/Consulting.tsx index 8abe34c..6645666 100644 --- a/src/pages/services/Consulting.tsx +++ b/src/pages/services/Consulting.tsx @@ -1,10 +1,11 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; - +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function Consulting() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/CultureCompetence.tsx b/src/pages/services/CultureCompetence.tsx index c9ef980..f455771 100644 --- a/src/pages/services/CultureCompetence.tsx +++ b/src/pages/services/CultureCompetence.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function CultureCompetence() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/ExecutiveCoaching.tsx b/src/pages/services/ExecutiveCoaching.tsx index f2129f4..c0b7e9c 100644 --- a/src/pages/services/ExecutiveCoaching.tsx +++ b/src/pages/services/ExecutiveCoaching.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function ExecutiveCoaching() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/LeadershipDevelopment.tsx b/src/pages/services/LeadershipDevelopment.tsx index 8e28030..c1ae9c6 100644 --- a/src/pages/services/LeadershipDevelopment.tsx +++ b/src/pages/services/LeadershipDevelopment.tsx @@ -1,10 +1,11 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; - +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function LeadershipDevelopment() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/LearningFacility.tsx b/src/pages/services/LearningFacility.tsx index ab8392a..4884376 100644 --- a/src/pages/services/LearningFacility.tsx +++ b/src/pages/services/LearningFacility.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function LearningFacility() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/ManagementDevelopment.tsx b/src/pages/services/ManagementDevelopment.tsx index efae245..4840d6f 100644 --- a/src/pages/services/ManagementDevelopment.tsx +++ b/src/pages/services/ManagementDevelopment.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function ManagementDevelopment() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null;
Want to explore first?{' '} navigateTo('/corporate/login')} + onClick={() => navigate('/corporate/login')} className="text-purple-600 hover:text-purple-700 font-medium hover:underline" > View login options @@ -285,14 +286,14 @@ export function LoginSelection() { navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[16px] min-h-[44px] border-[#04045B] text-[#04045B] hover:bg-[#04045B]/10" > Contact Support navigateTo('/individual-webinars')} + onClick={() => navigate('/individual-webinars')} className="text-[16px] min-h-[44px] border-[#04045B] text-[#04045B] hover:bg-[#04045B]/10" > Explore Learning Resources diff --git a/src/pages/MyCohort.tsx b/src/pages/MyCohort.tsx index cf0eb25..0613ebc 100644 --- a/src/pages/MyCohort.tsx +++ b/src/pages/MyCohort.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function MyCohort() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/NotFound.tsx b/src/pages/NotFound.tsx index 32f2c61..4964d76 100644 --- a/src/pages/NotFound.tsx +++ b/src/pages/NotFound.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent } from '../components/ui/card'; import { ArrowLeft, Home, Search, HelpCircle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function NotFound() { const handleGoHome = () => { - navigateTo('/'); + navigate('/'); }; const handleGoBack = () => { @@ -56,7 +56,7 @@ export function NotFound() { navigateTo('/individual-webinars')} + onClick={() => navigate('/individual-webinars')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -64,7 +64,7 @@ export function NotFound() { navigateTo('/contact')} + onClick={() => navigate('/contact')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -72,7 +72,7 @@ export function NotFound() { navigateTo('/auth')} + onClick={() => navigate('/auth')} className="flex items-center gap-3 p-3 text-left rounded-lg hover:bg-gray-50 transition-colors" > @@ -86,7 +86,7 @@ export function NotFound() { Still need help? Contact our{' '} navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[#04045B] hover:text-[#04045B]/80 font-medium" > support team diff --git a/src/pages/OrderConfirmation.tsx b/src/pages/OrderConfirmation.tsx index 0e67198..394deb9 100644 --- a/src/pages/OrderConfirmation.tsx +++ b/src/pages/OrderConfirmation.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OrderConfirmation() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OrderFailed.tsx b/src/pages/OrderFailed.tsx index 26f5ad5..5b94f4a 100644 --- a/src/pages/OrderFailed.tsx +++ b/src/pages/OrderFailed.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OrderFailed() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurExpertise.tsx b/src/pages/OurExpertise.tsx index 3b0fd83..6846d5d 100644 --- a/src/pages/OurExpertise.tsx +++ b/src/pages/OurExpertise.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurExpertise() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurImpact.tsx b/src/pages/OurImpact.tsx index dfce49f..768283b 100644 --- a/src/pages/OurImpact.tsx +++ b/src/pages/OurImpact.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurImpact() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurTeam.tsx b/src/pages/OurTeam.tsx index c2f6441..fe0c72f 100644 --- a/src/pages/OurTeam.tsx +++ b/src/pages/OurTeam.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurTeam() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurVision.tsx b/src/pages/OurVision.tsx index 570a9af..9a45c0a 100644 --- a/src/pages/OurVision.tsx +++ b/src/pages/OurVision.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurVision() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Privacy.tsx b/src/pages/Privacy.tsx index 66bee11..992227d 100644 --- a/src/pages/Privacy.tsx +++ b/src/pages/Privacy.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Shield, Eye, Lock, FileText } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Privacy() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( diff --git a/src/pages/ProgrammeCatalogue.tsx b/src/pages/ProgrammeCatalogue.tsx index 7fe4c2b..0a44590 100644 --- a/src/pages/ProgrammeCatalogue.tsx +++ b/src/pages/ProgrammeCatalogue.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ProgrammeCatalogue() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/ProgrammeDetail.tsx b/src/pages/ProgrammeDetail.tsx index f9a5ad3..eb92efb 100644 --- a/src/pages/ProgrammeDetail.tsx +++ b/src/pages/ProgrammeDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ProgrammeDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Resources.tsx b/src/pages/Resources.tsx index 4c7267d..a433272 100644 --- a/src/pages/Resources.tsx +++ b/src/pages/Resources.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Resources() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index 363c567..482c52c 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -56,13 +56,15 @@ import { HelpCircle, ExternalLink } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +import { useNavigate } from 'react-router-dom'; interface SettingsProps { userType?: 'individual' | 'corporate'; } export function Settings({ userType: propUserType }: SettingsProps) { + + const navigate = useNavigate(); // Enhanced user type detection with multiple fallbacks const getQueryParam = (param: string) => { const urlParams = new URLSearchParams(window.location.search); @@ -1169,7 +1171,7 @@ export function Settings({ userType: propUserType }: SettingsProps) { navigateTo('/privacy')} + onClick={() => navigate('/privacy')} className="text-base min-h-[44px]" > diff --git a/src/pages/Signup.tsx b/src/pages/Signup.tsx index fe255b8..824f37e 100644 --- a/src/pages/Signup.tsx +++ b/src/pages/Signup.tsx @@ -3,7 +3,7 @@ import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Eye, EyeOff, Mail, Lock, User } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Signup() { const [formData, setFormData] = useState({ @@ -24,7 +24,7 @@ export function Signup() { try { // Simulate signup await new Promise(resolve => setTimeout(resolve, 1000)); - navigateTo('/email-verification'); + navigate('/email-verification'); } catch (error) { console.error('Signup failed:', error); } finally { @@ -33,7 +33,7 @@ export function Signup() { }; const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( @@ -195,7 +195,7 @@ export function Signup() { I agree to the{' '} navigateTo('/terms')} + onClick={() => navigate('/terms')} className="text-primary hover:text-primary/80 font-medium" > Terms of Service @@ -203,7 +203,7 @@ export function Signup() { {' '}and{' '} navigateTo('/privacy')} + onClick={() => navigate('/privacy')} className="text-primary hover:text-primary/80 font-medium" > Privacy Policy @@ -224,7 +224,7 @@ export function Signup() { Already have an account?{' '} navigateTo('/auth')} + onClick={() => navigate('/auth')} className="text-primary hover:text-primary/80 font-medium" > Sign in here diff --git a/src/pages/Surveys.tsx b/src/pages/Surveys.tsx index 0c5dcbb..fc3933b 100644 --- a/src/pages/Surveys.tsx +++ b/src/pages/Surveys.tsx @@ -39,9 +39,9 @@ import { Globe, ExternalLink } from 'lucide-react'; -import { navigateTo } from '../components/Router'; import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, PieChart, Pie, Cell } from 'recharts'; import exampleImage from 'figma:asset/c501c3d3f3a828828d4cb2dadb9558b43986718f.png'; +import { useNavigate } from 'react-router-dom'; interface SurveyProps { userType: 'individual' | 'corporate'; @@ -380,6 +380,7 @@ function SurveyCard({ export function Surveys({ userType = 'individual' }: SurveyProps) { const [activeTab, setActiveTab] = useState<'available' | 'completed'>('available'); + const navigate = useNavigate(); // Mock user data for LearnerLayout - matching Library page pattern const user = { diff --git a/src/pages/TeamLeadership.tsx b/src/pages/TeamLeadership.tsx index 8ea2ec3..20f9759 100644 --- a/src/pages/TeamLeadership.tsx +++ b/src/pages/TeamLeadership.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function TeamLeadership() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Terms.tsx b/src/pages/Terms.tsx index 88e82fc..dba47ba 100644 --- a/src/pages/Terms.tsx +++ b/src/pages/Terms.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, FileText, Scale, AlertCircle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Terms() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( diff --git a/src/pages/WebinarDetail.tsx b/src/pages/WebinarDetail.tsx index 78af510..d8fff7d 100644 --- a/src/pages/WebinarDetail.tsx +++ b/src/pages/WebinarDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function WebinarDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/WebinarListing.tsx b/src/pages/WebinarListing.tsx index 9718450..f5e8526 100644 --- a/src/pages/WebinarListing.tsx +++ b/src/pages/WebinarListing.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function WebinarListing() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/learner/CorporateDashboard.tsx b/src/pages/learner/CorporateDashboard.tsx index f4fb94f..8e0109f 100644 --- a/src/pages/learner/CorporateDashboard.tsx +++ b/src/pages/learner/CorporateDashboard.tsx @@ -46,10 +46,10 @@ import { Globe, MapPin } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; import { ImageWithFallback } from '../../components/figma/ImageWithFallback'; import globalMapImage from 'figma:asset/1b56e6afe31d5744d2e7a38d3e2f8c3ce78a90af.png'; - +import { useNavigate } from 'react-router-dom'; + const navigate = useNavigate(); // Loading skeleton component for corporate dashboard function CorporateDashboardSkeleton() { return ( @@ -422,7 +422,7 @@ function CorporateAnalytics() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="text-base h-auto p-0 text-primary hover:text-primary/80" > View Reports @@ -506,7 +506,7 @@ function CorporateAnalytics() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="w-full text-base h-11" > View Detailed Analytics @@ -622,7 +622,7 @@ function AssignedTraining() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="text-base h-10" > View All @@ -639,7 +639,7 @@ function AssignedTraining() { className={`group cursor-pointer bg-white rounded-lg border transition-all duration-200 flex flex-col h-full overflow-hidden ${ assignment.status === 'urgent' ? 'border-destructive/30 bg-destructive/5' : 'border-border hover:shadow-md' }`} - onClick={() => navigateTo(`/library?view=corporate&courseId=${assignment.id}&tab=overview`)} + onClick={() => navigate(`/library?view=corporate&courseId=${assignment.id}&tab=overview`)} > {/* Course Image */} @@ -724,7 +724,7 @@ function AssignedTraining() { className="w-full text-base h-10" onClick={(e) => { e.stopPropagation(); - navigateTo(`/library?view=corporate&courseId=${assignment.id}&tab=overview`); + navigate(`/library?view=corporate&courseId=${assignment.id}&tab=overview`); }} > {assignment.status === 'urgent' ? 'Start Now' : 'Begin Training'} @@ -764,7 +764,7 @@ function TeamLeaderboard() { navigateTo('/leaderboard?view=corporate')} + onClick={() => navigate('/leaderboard?view=corporate')} className="text-base h-10 border-2 border-brand-navy/15 text-brand-navy/80 hover:bg-brand-navy/3 font-semibold" > View All diff --git a/src/pages/learner/CourseTimeline.tsx b/src/pages/learner/CourseTimeline.tsx index df1e7cc..273ec14 100644 --- a/src/pages/learner/CourseTimeline.tsx +++ b/src/pages/learner/CourseTimeline.tsx @@ -43,7 +43,8 @@ import { ChevronDown, ChevronUp } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; interface CourseTimelineProps { userType?: 'individual' | 'corporate'; @@ -458,7 +459,7 @@ function CourseHeader({ course }: { course: Course }) { {/* Breadcrumb Navigation */} navigateTo('/dashboard')} + onClick={() => navigate('/dashboard')} className="hover:text-foreground transition-colors active:bg-gray-100 focus:outline-none px-2 py-1 rounded" style={{ outline: 'none' }} > @@ -466,7 +467,7 @@ function CourseHeader({ course }: { course: Course }) { navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-foreground transition-colors active:bg-gray-100 focus:outline-none px-2 py-1 rounded" style={{ outline: 'none' }} > @@ -962,6 +963,8 @@ export function CourseTimeline({ userType = 'individual' }: CourseTimelineProps) const [activeTab, setActiveTab] = useState('overview'); const [course, setCourse] = useState(null); const [isLoading, setIsLoading] = useState(true); + const navigate = useNavigate(); + // Mock user data const user = { @@ -1017,14 +1020,14 @@ export function CourseTimeline({ userType = 'individual' }: CourseTimelineProps) {/* Breadcrumb Navigation */} navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-[#04045B] transition-colors" > Library navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-[#04045B] transition-colors" > Leadership Development diff --git a/src/pages/learner/Dashboard.tsx b/src/pages/learner/Dashboard.tsx index a16064a..230d693 100644 --- a/src/pages/learner/Dashboard.tsx +++ b/src/pages/learner/Dashboard.tsx @@ -75,13 +75,15 @@ import { Monitor, PieChart } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; +// import { navigate } from '../../components/Router'; import { ImageWithFallback } from '../../components/figma/ImageWithFallback'; import CurrentLearningHeaderIcon from '../../imports/CurrentLearningHeaderIcon-4285-106'; import platinumTrophy from 'figma:asset/a224fb6efc954992c535e482fe88d93f1f4178d8.png'; import goldTrophy from 'figma:asset/9ebc01e8eb24f9d71683b2ee63d224583a979590.png'; import silverTrophy from 'figma:asset/9852710543a90e291ecb85d77ea02234139264c5.png'; import bronzeTrophy from 'figma:asset/5fddc261d2e35ee810113f2537c5a59a97fd7fbd.png'; +import { useNavigate } from 'react-router-dom'; + interface DashboardProps { userType?: 'individual' | 'corporate'; @@ -187,7 +189,7 @@ function RecentActivity() { navigateTo('/dashboard?view=individual&tab=activity')} + onClick={() => navigate('/dashboard?view=individual&tab=activity')} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-3 py-1.5 min-h-[48px] font-medium" > View All @@ -806,7 +808,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi {currentCourse.currentModule.title} navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} className="w-full text-base min-h-[48px] bg-brand-gold hover:bg-brand-gold/90 text-brand-charcoal font-medium" > Continue Module → @@ -826,7 +828,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.nextModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.nextModule.number}`)} className="w-full text-base min-h-[48px] border-brand-navy text-brand-navy hover:bg-brand-navy/10 font-medium" > Preview Module → @@ -840,7 +842,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi Course Modules navigateTo(`/course?view=${userType}&courseId=strategic-leadership`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership`)} className="text-sm text-brand-navy hover:text-brand-navy hover:bg-brand-navy/10 p-0 h-auto font-medium" > View All → @@ -875,7 +877,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership`)} className="text-base text-gray-600 hover:text-gray-900 hover:bg-gray-50 p-0 min-h-[48px] font-medium flex items-center gap-1" > @@ -883,7 +885,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} className="text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium px-6" > @@ -990,7 +992,7 @@ function GlobalLeaderboard() { navigateTo('/leaderboard?view=individual')} + onClick={() => navigate('/leaderboard?view=individual')} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-sm px-3 py-1.5 h-auto font-medium" > View All @@ -1111,7 +1113,7 @@ function ActivityRecommendations({ userType = 'individual' }: { userType?: 'indi navigateTo(`/library?view=${userType}`)} + onClick={() => navigate(`/library?view=${userType}`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View All Courses @@ -1160,7 +1162,7 @@ function ActivityRecommendations({ userType = 'individual' }: { userType?: 'indi {/* Enroll Button */} navigateTo(`/course?view=${userType}&courseId=${course.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${course.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > Enroll Now @@ -1243,7 +1245,7 @@ function RecentlyViewed({ userType = 'individual' }: { userType?: 'individual' | navigateTo(`/library?view=${userType}&filter=recent`)} + onClick={() => navigate(`/library?view=${userType}&filter=recent`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View History @@ -1298,7 +1300,7 @@ function RecentlyViewed({ userType = 'individual' }: { userType?: 'individual' | {/* Action Button */} navigateTo(`/course?view=${userType}&courseId=${item.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${item.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > {item.progress === 100 ? 'Review' : item.progress > 0 ? 'Continue' : 'Start'} @@ -1373,7 +1375,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua navigateTo(`/library?view=${userType}&filter=trending`)} + onClick={() => navigate(`/library?view=${userType}&filter=trending`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View Trending @@ -1422,7 +1424,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua {/* Enroll Button */} navigateTo(`/course?view=${userType}&courseId=${content.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${content.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > Enroll Now @@ -1437,6 +1439,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua // Main Dashboard component export default function Dashboard({ userType = 'individual' }: DashboardProps) { + const navigate = useNavigate(); const user = { name: 'Alex', email: 'alex@example.com' }; return ( diff --git a/src/pages/learner/Library.tsx b/src/pages/learner/Library.tsx index 80f0be9..74a2be1 100644 --- a/src/pages/learner/Library.tsx +++ b/src/pages/learner/Library.tsx @@ -10,7 +10,9 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../components/ui/ta import { Skeleton } from '../../components/ui/skeleton'; import { BookOpen, Filter, Search } from 'lucide-react'; import { getCoursesData, Course } from './data/libraryData'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + interface LibraryProps { userType?: 'individual' | 'corporate'; @@ -51,6 +53,7 @@ function LibrarySkeleton() { export function Library({ userType = 'individual' }: LibraryProps) { const [isLoading, setIsLoading] = useState(true); const [courses] = useState(getCoursesData(userType)); + const navigate = useNavigate(); // Filter states const [searchQuery, setSearchQuery] = useState(''); @@ -155,12 +158,12 @@ export function Library({ userType = 'individual' }: LibraryProps) { const handleEnrollCourse = (courseId: string) => { console.log('Enrolling in course:', courseId); - navigateTo(`/course/${courseId}?view=${userType}`); + navigate(`/course/${courseId}?view=${userType}`); }; const handleContinueCourse = (courseId: string) => { console.log('Continuing course:', courseId); - navigateTo(`/course/${courseId}?view=${userType}`); + navigate(`/course/${courseId}?view=${userType}`); }; const handleBookmarkCourse = (courseId: string) => { diff --git a/src/pages/services/Consulting.tsx b/src/pages/services/Consulting.tsx index 8abe34c..6645666 100644 --- a/src/pages/services/Consulting.tsx +++ b/src/pages/services/Consulting.tsx @@ -1,10 +1,11 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; - +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function Consulting() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/CultureCompetence.tsx b/src/pages/services/CultureCompetence.tsx index c9ef980..f455771 100644 --- a/src/pages/services/CultureCompetence.tsx +++ b/src/pages/services/CultureCompetence.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function CultureCompetence() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/ExecutiveCoaching.tsx b/src/pages/services/ExecutiveCoaching.tsx index f2129f4..c0b7e9c 100644 --- a/src/pages/services/ExecutiveCoaching.tsx +++ b/src/pages/services/ExecutiveCoaching.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function ExecutiveCoaching() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/LeadershipDevelopment.tsx b/src/pages/services/LeadershipDevelopment.tsx index 8e28030..c1ae9c6 100644 --- a/src/pages/services/LeadershipDevelopment.tsx +++ b/src/pages/services/LeadershipDevelopment.tsx @@ -1,10 +1,11 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; - +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function LeadershipDevelopment() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/LearningFacility.tsx b/src/pages/services/LearningFacility.tsx index ab8392a..4884376 100644 --- a/src/pages/services/LearningFacility.tsx +++ b/src/pages/services/LearningFacility.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function LearningFacility() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/ManagementDevelopment.tsx b/src/pages/services/ManagementDevelopment.tsx index efae245..4840d6f 100644 --- a/src/pages/services/ManagementDevelopment.tsx +++ b/src/pages/services/ManagementDevelopment.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function ManagementDevelopment() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null;
Still need help? Contact our{' '} navigateTo('/contact')} + onClick={() => navigate('/contact')} className="text-[#04045B] hover:text-[#04045B]/80 font-medium" > support team diff --git a/src/pages/OrderConfirmation.tsx b/src/pages/OrderConfirmation.tsx index 0e67198..394deb9 100644 --- a/src/pages/OrderConfirmation.tsx +++ b/src/pages/OrderConfirmation.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OrderConfirmation() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OrderFailed.tsx b/src/pages/OrderFailed.tsx index 26f5ad5..5b94f4a 100644 --- a/src/pages/OrderFailed.tsx +++ b/src/pages/OrderFailed.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OrderFailed() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurExpertise.tsx b/src/pages/OurExpertise.tsx index 3b0fd83..6846d5d 100644 --- a/src/pages/OurExpertise.tsx +++ b/src/pages/OurExpertise.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurExpertise() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurImpact.tsx b/src/pages/OurImpact.tsx index dfce49f..768283b 100644 --- a/src/pages/OurImpact.tsx +++ b/src/pages/OurImpact.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurImpact() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurTeam.tsx b/src/pages/OurTeam.tsx index c2f6441..fe0c72f 100644 --- a/src/pages/OurTeam.tsx +++ b/src/pages/OurTeam.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurTeam() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/OurVision.tsx b/src/pages/OurVision.tsx index 570a9af..9a45c0a 100644 --- a/src/pages/OurVision.tsx +++ b/src/pages/OurVision.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function OurVision() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Privacy.tsx b/src/pages/Privacy.tsx index 66bee11..992227d 100644 --- a/src/pages/Privacy.tsx +++ b/src/pages/Privacy.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, Shield, Eye, Lock, FileText } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Privacy() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( diff --git a/src/pages/ProgrammeCatalogue.tsx b/src/pages/ProgrammeCatalogue.tsx index 7fe4c2b..0a44590 100644 --- a/src/pages/ProgrammeCatalogue.tsx +++ b/src/pages/ProgrammeCatalogue.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ProgrammeCatalogue() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/ProgrammeDetail.tsx b/src/pages/ProgrammeDetail.tsx index f9a5ad3..eb92efb 100644 --- a/src/pages/ProgrammeDetail.tsx +++ b/src/pages/ProgrammeDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function ProgrammeDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Resources.tsx b/src/pages/Resources.tsx index 4c7267d..a433272 100644 --- a/src/pages/Resources.tsx +++ b/src/pages/Resources.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Resources() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index 363c567..482c52c 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -56,13 +56,15 @@ import { HelpCircle, ExternalLink } from 'lucide-react'; -import { navigateTo } from '../components/Router'; +import { useNavigate } from 'react-router-dom'; interface SettingsProps { userType?: 'individual' | 'corporate'; } export function Settings({ userType: propUserType }: SettingsProps) { + + const navigate = useNavigate(); // Enhanced user type detection with multiple fallbacks const getQueryParam = (param: string) => { const urlParams = new URLSearchParams(window.location.search); @@ -1169,7 +1171,7 @@ export function Settings({ userType: propUserType }: SettingsProps) {
Already have an account?{' '} navigateTo('/auth')} + onClick={() => navigate('/auth')} className="text-primary hover:text-primary/80 font-medium" > Sign in here diff --git a/src/pages/Surveys.tsx b/src/pages/Surveys.tsx index 0c5dcbb..fc3933b 100644 --- a/src/pages/Surveys.tsx +++ b/src/pages/Surveys.tsx @@ -39,9 +39,9 @@ import { Globe, ExternalLink } from 'lucide-react'; -import { navigateTo } from '../components/Router'; import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, PieChart, Pie, Cell } from 'recharts'; import exampleImage from 'figma:asset/c501c3d3f3a828828d4cb2dadb9558b43986718f.png'; +import { useNavigate } from 'react-router-dom'; interface SurveyProps { userType: 'individual' | 'corporate'; @@ -380,6 +380,7 @@ function SurveyCard({ export function Surveys({ userType = 'individual' }: SurveyProps) { const [activeTab, setActiveTab] = useState<'available' | 'completed'>('available'); + const navigate = useNavigate(); // Mock user data for LearnerLayout - matching Library page pattern const user = { diff --git a/src/pages/TeamLeadership.tsx b/src/pages/TeamLeadership.tsx index 8ea2ec3..20f9759 100644 --- a/src/pages/TeamLeadership.tsx +++ b/src/pages/TeamLeadership.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function TeamLeadership() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/Terms.tsx b/src/pages/Terms.tsx index 88e82fc..dba47ba 100644 --- a/src/pages/Terms.tsx +++ b/src/pages/Terms.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { Button } from '../components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '../components/ui/card'; import { ArrowLeft, FileText, Scale, AlertCircle } from 'lucide-react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function Terms() { const handleBackNavigation = () => { - navigateTo('/'); + navigate('/'); }; return ( diff --git a/src/pages/WebinarDetail.tsx b/src/pages/WebinarDetail.tsx index 78af510..d8fff7d 100644 --- a/src/pages/WebinarDetail.tsx +++ b/src/pages/WebinarDetail.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function WebinarDetail() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/WebinarListing.tsx b/src/pages/WebinarListing.tsx index 9718450..f5e8526 100644 --- a/src/pages/WebinarListing.tsx +++ b/src/pages/WebinarListing.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../components/Router'; + const navigate = useNavigate(); export function WebinarListing() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/learner/CorporateDashboard.tsx b/src/pages/learner/CorporateDashboard.tsx index f4fb94f..8e0109f 100644 --- a/src/pages/learner/CorporateDashboard.tsx +++ b/src/pages/learner/CorporateDashboard.tsx @@ -46,10 +46,10 @@ import { Globe, MapPin } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; import { ImageWithFallback } from '../../components/figma/ImageWithFallback'; import globalMapImage from 'figma:asset/1b56e6afe31d5744d2e7a38d3e2f8c3ce78a90af.png'; - +import { useNavigate } from 'react-router-dom'; + const navigate = useNavigate(); // Loading skeleton component for corporate dashboard function CorporateDashboardSkeleton() { return ( @@ -422,7 +422,7 @@ function CorporateAnalytics() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="text-base h-auto p-0 text-primary hover:text-primary/80" > View Reports @@ -506,7 +506,7 @@ function CorporateAnalytics() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="w-full text-base h-11" > View Detailed Analytics @@ -622,7 +622,7 @@ function AssignedTraining() { navigateTo('/library?view=corporate')} + onClick={() => navigate('/library?view=corporate')} className="text-base h-10" > View All @@ -639,7 +639,7 @@ function AssignedTraining() { className={`group cursor-pointer bg-white rounded-lg border transition-all duration-200 flex flex-col h-full overflow-hidden ${ assignment.status === 'urgent' ? 'border-destructive/30 bg-destructive/5' : 'border-border hover:shadow-md' }`} - onClick={() => navigateTo(`/library?view=corporate&courseId=${assignment.id}&tab=overview`)} + onClick={() => navigate(`/library?view=corporate&courseId=${assignment.id}&tab=overview`)} > {/* Course Image */} @@ -724,7 +724,7 @@ function AssignedTraining() { className="w-full text-base h-10" onClick={(e) => { e.stopPropagation(); - navigateTo(`/library?view=corporate&courseId=${assignment.id}&tab=overview`); + navigate(`/library?view=corporate&courseId=${assignment.id}&tab=overview`); }} > {assignment.status === 'urgent' ? 'Start Now' : 'Begin Training'} @@ -764,7 +764,7 @@ function TeamLeaderboard() { navigateTo('/leaderboard?view=corporate')} + onClick={() => navigate('/leaderboard?view=corporate')} className="text-base h-10 border-2 border-brand-navy/15 text-brand-navy/80 hover:bg-brand-navy/3 font-semibold" > View All diff --git a/src/pages/learner/CourseTimeline.tsx b/src/pages/learner/CourseTimeline.tsx index df1e7cc..273ec14 100644 --- a/src/pages/learner/CourseTimeline.tsx +++ b/src/pages/learner/CourseTimeline.tsx @@ -43,7 +43,8 @@ import { ChevronDown, ChevronUp } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; interface CourseTimelineProps { userType?: 'individual' | 'corporate'; @@ -458,7 +459,7 @@ function CourseHeader({ course }: { course: Course }) { {/* Breadcrumb Navigation */} navigateTo('/dashboard')} + onClick={() => navigate('/dashboard')} className="hover:text-foreground transition-colors active:bg-gray-100 focus:outline-none px-2 py-1 rounded" style={{ outline: 'none' }} > @@ -466,7 +467,7 @@ function CourseHeader({ course }: { course: Course }) { navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-foreground transition-colors active:bg-gray-100 focus:outline-none px-2 py-1 rounded" style={{ outline: 'none' }} > @@ -962,6 +963,8 @@ export function CourseTimeline({ userType = 'individual' }: CourseTimelineProps) const [activeTab, setActiveTab] = useState('overview'); const [course, setCourse] = useState(null); const [isLoading, setIsLoading] = useState(true); + const navigate = useNavigate(); + // Mock user data const user = { @@ -1017,14 +1020,14 @@ export function CourseTimeline({ userType = 'individual' }: CourseTimelineProps) {/* Breadcrumb Navigation */} navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-[#04045B] transition-colors" > Library navigateTo('/library')} + onClick={() => navigate('/library')} className="hover:text-[#04045B] transition-colors" > Leadership Development diff --git a/src/pages/learner/Dashboard.tsx b/src/pages/learner/Dashboard.tsx index a16064a..230d693 100644 --- a/src/pages/learner/Dashboard.tsx +++ b/src/pages/learner/Dashboard.tsx @@ -75,13 +75,15 @@ import { Monitor, PieChart } from 'lucide-react'; -import { navigateTo } from '../../components/Router'; +// import { navigate } from '../../components/Router'; import { ImageWithFallback } from '../../components/figma/ImageWithFallback'; import CurrentLearningHeaderIcon from '../../imports/CurrentLearningHeaderIcon-4285-106'; import platinumTrophy from 'figma:asset/a224fb6efc954992c535e482fe88d93f1f4178d8.png'; import goldTrophy from 'figma:asset/9ebc01e8eb24f9d71683b2ee63d224583a979590.png'; import silverTrophy from 'figma:asset/9852710543a90e291ecb85d77ea02234139264c5.png'; import bronzeTrophy from 'figma:asset/5fddc261d2e35ee810113f2537c5a59a97fd7fbd.png'; +import { useNavigate } from 'react-router-dom'; + interface DashboardProps { userType?: 'individual' | 'corporate'; @@ -187,7 +189,7 @@ function RecentActivity() { navigateTo('/dashboard?view=individual&tab=activity')} + onClick={() => navigate('/dashboard?view=individual&tab=activity')} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-3 py-1.5 min-h-[48px] font-medium" > View All @@ -806,7 +808,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi {currentCourse.currentModule.title} navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} className="w-full text-base min-h-[48px] bg-brand-gold hover:bg-brand-gold/90 text-brand-charcoal font-medium" > Continue Module → @@ -826,7 +828,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.nextModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.nextModule.number}`)} className="w-full text-base min-h-[48px] border-brand-navy text-brand-navy hover:bg-brand-navy/10 font-medium" > Preview Module → @@ -840,7 +842,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi Course Modules navigateTo(`/course?view=${userType}&courseId=strategic-leadership`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership`)} className="text-sm text-brand-navy hover:text-brand-navy hover:bg-brand-navy/10 p-0 h-auto font-medium" > View All → @@ -875,7 +877,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership`)} className="text-base text-gray-600 hover:text-gray-900 hover:bg-gray-50 p-0 min-h-[48px] font-medium flex items-center gap-1" > @@ -883,7 +885,7 @@ function CurrentLearningProgress({ userType = 'individual' }: { userType?: 'indi navigateTo(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=strategic-leadership&module=${currentCourse.currentModule.number}`)} className="text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium px-6" > @@ -990,7 +992,7 @@ function GlobalLeaderboard() { navigateTo('/leaderboard?view=individual')} + onClick={() => navigate('/leaderboard?view=individual')} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-sm px-3 py-1.5 h-auto font-medium" > View All @@ -1111,7 +1113,7 @@ function ActivityRecommendations({ userType = 'individual' }: { userType?: 'indi navigateTo(`/library?view=${userType}`)} + onClick={() => navigate(`/library?view=${userType}`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View All Courses @@ -1160,7 +1162,7 @@ function ActivityRecommendations({ userType = 'individual' }: { userType?: 'indi {/* Enroll Button */} navigateTo(`/course?view=${userType}&courseId=${course.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${course.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > Enroll Now @@ -1243,7 +1245,7 @@ function RecentlyViewed({ userType = 'individual' }: { userType?: 'individual' | navigateTo(`/library?view=${userType}&filter=recent`)} + onClick={() => navigate(`/library?view=${userType}&filter=recent`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View History @@ -1298,7 +1300,7 @@ function RecentlyViewed({ userType = 'individual' }: { userType?: 'individual' | {/* Action Button */} navigateTo(`/course?view=${userType}&courseId=${item.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${item.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > {item.progress === 100 ? 'Review' : item.progress > 0 ? 'Continue' : 'Start'} @@ -1373,7 +1375,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua navigateTo(`/library?view=${userType}&filter=trending`)} + onClick={() => navigate(`/library?view=${userType}&filter=trending`)} className="text-brand-navy hover:bg-brand-navy/10 border-brand-navy/20 text-base px-4 py-2 h-auto font-medium" > View Trending @@ -1422,7 +1424,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua {/* Enroll Button */} navigateTo(`/course?view=${userType}&courseId=${content.id}`)} + onClick={() => navigate(`/course?view=${userType}&courseId=${content.id}`)} className="w-full text-base min-h-[48px] bg-brand-navy hover:bg-brand-navy/90 text-white font-medium" > Enroll Now @@ -1437,6 +1439,7 @@ function WhatOthersLearning({ userType = 'individual' }: { userType?: 'individua // Main Dashboard component export default function Dashboard({ userType = 'individual' }: DashboardProps) { + const navigate = useNavigate(); const user = { name: 'Alex', email: 'alex@example.com' }; return ( diff --git a/src/pages/learner/Library.tsx b/src/pages/learner/Library.tsx index 80f0be9..74a2be1 100644 --- a/src/pages/learner/Library.tsx +++ b/src/pages/learner/Library.tsx @@ -10,7 +10,9 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../components/ui/ta import { Skeleton } from '../../components/ui/skeleton'; import { BookOpen, Filter, Search } from 'lucide-react'; import { getCoursesData, Course } from './data/libraryData'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + interface LibraryProps { userType?: 'individual' | 'corporate'; @@ -51,6 +53,7 @@ function LibrarySkeleton() { export function Library({ userType = 'individual' }: LibraryProps) { const [isLoading, setIsLoading] = useState(true); const [courses] = useState(getCoursesData(userType)); + const navigate = useNavigate(); // Filter states const [searchQuery, setSearchQuery] = useState(''); @@ -155,12 +158,12 @@ export function Library({ userType = 'individual' }: LibraryProps) { const handleEnrollCourse = (courseId: string) => { console.log('Enrolling in course:', courseId); - navigateTo(`/course/${courseId}?view=${userType}`); + navigate(`/course/${courseId}?view=${userType}`); }; const handleContinueCourse = (courseId: string) => { console.log('Continuing course:', courseId); - navigateTo(`/course/${courseId}?view=${userType}`); + navigate(`/course/${courseId}?view=${userType}`); }; const handleBookmarkCourse = (courseId: string) => { diff --git a/src/pages/services/Consulting.tsx b/src/pages/services/Consulting.tsx index 8abe34c..6645666 100644 --- a/src/pages/services/Consulting.tsx +++ b/src/pages/services/Consulting.tsx @@ -1,10 +1,11 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; - +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function Consulting() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/CultureCompetence.tsx b/src/pages/services/CultureCompetence.tsx index c9ef980..f455771 100644 --- a/src/pages/services/CultureCompetence.tsx +++ b/src/pages/services/CultureCompetence.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function CultureCompetence() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/ExecutiveCoaching.tsx b/src/pages/services/ExecutiveCoaching.tsx index f2129f4..c0b7e9c 100644 --- a/src/pages/services/ExecutiveCoaching.tsx +++ b/src/pages/services/ExecutiveCoaching.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function ExecutiveCoaching() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/LeadershipDevelopment.tsx b/src/pages/services/LeadershipDevelopment.tsx index 8e28030..c1ae9c6 100644 --- a/src/pages/services/LeadershipDevelopment.tsx +++ b/src/pages/services/LeadershipDevelopment.tsx @@ -1,10 +1,11 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; - +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function LeadershipDevelopment() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/LearningFacility.tsx b/src/pages/services/LearningFacility.tsx index ab8392a..4884376 100644 --- a/src/pages/services/LearningFacility.tsx +++ b/src/pages/services/LearningFacility.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function LearningFacility() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null; diff --git a/src/pages/services/ManagementDevelopment.tsx b/src/pages/services/ManagementDevelopment.tsx index efae245..4840d6f 100644 --- a/src/pages/services/ManagementDevelopment.tsx +++ b/src/pages/services/ManagementDevelopment.tsx @@ -1,10 +1,12 @@ import React, { useEffect } from 'react'; -import { navigateTo } from '../../components/Router'; +import { useNavigate } from 'react-router-dom'; +// import { navigate } from '../../components/Router'; + const navigate = useNavigate(); export function ManagementDevelopment() { useEffect(() => { // This is a deprecated page, redirect to home - navigateTo('/'); + navigate('/'); }, []); return null;