Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Welcome - Navigation and Routing #2263

Closed
alonp99 opened this issue Mar 31, 2024 · 0 comments · Fixed by #2281
Closed

Welcome - Navigation and Routing #2263

alonp99 opened this issue Mar 31, 2024 · 0 comments · Fixed by #2281

Comments

@alonp99
Copy link
Collaborator

alonp99 commented Mar 31, 2024

Description

Add a "Home" page to the navigation bar, represented by the Home icon.
Integrate the new "Statistics" and "Cases" routes into the application's routing structure within the authenticated layout.
Modify authentication redirects to point to the "Statistics" page.
Code References (Example):

 // useNavbarLogic.tsx
 import { Home } from 'lucide-react';

 const navItems = [ 
     {
         label: 'Home',
         href: '/en/statistics',
         icon: Home 
     }, 
     // ...existing navItems
 ]; 

// Router.tsx

{
        element: <AuthenticatedLayout />,
        loader: authenticatedLayoutLoader,
        errorElement: <RouteError />,
        children: [
          {
            path: '/:locale',
            element: <Locale />,
            errorElement: <RouteError />,
            children: [
                // ... existing children
               {
                path: '/:locale/statistics',
                element: <Statistics />,
                errorElement: <RouteError />,
               },
              {
                path: '/:locale/workflows',
                element: <Workflows />,
                errorElement: <RouteError />,
               }
            ]
           }
        ]
}

// Providers.tsx

      <AuthProvider
        redirectAuthenticatedTo={'/en/statistics'}
        signInOptions={{
          callbackUrl: state?.from
            ? ...
            : '/en/statistics',
        }}
       // ...rest of props
      >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants