ballerine
ballerine copied to clipboard
Welcome - Navigation and Routing
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
>