ballerine icon indicating copy to clipboard operation
ballerine copied to clipboard

Welcome - Navigation and Routing

Open alonp99 opened this issue 10 months ago • 0 comments

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
      >

alonp99 avatar Mar 31 '24 21:03 alonp99