fix
This commit is contained in:
parent
32750a0cd7
commit
66669e575b
@ -62,7 +62,6 @@ const NavBar = () => {
|
|||||||
}, 150);
|
}, 150);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Fonction pour fermer le menu lorsqu'on clique sur un lien sur mobile
|
|
||||||
const handleCloseMenu = () => {
|
const handleCloseMenu = () => {
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
toggleSidebar();
|
toggleSidebar();
|
||||||
@ -78,12 +77,12 @@ const NavBar = () => {
|
|||||||
{
|
{
|
||||||
title: 'Résumé hebdomadaire',
|
title: 'Résumé hebdomadaire',
|
||||||
href: '/weekly-summary',
|
href: '/weekly-summary',
|
||||||
icon: CalendarDays,
|
icon: Clock,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Pointage',
|
title: 'Pointage',
|
||||||
href: '/pointage',
|
href: '/pointage',
|
||||||
icon: Clock,
|
icon: CalendarDays,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -93,20 +92,18 @@ const NavBar = () => {
|
|||||||
onMouseEnter={handleMouseEnter}
|
onMouseEnter={handleMouseEnter}
|
||||||
onMouseLeave={handleMouseLeave}
|
onMouseLeave={handleMouseLeave}
|
||||||
>
|
>
|
||||||
|
|
||||||
{/* Logo / nom de la boulangerie */}
|
{/* Logo / nom de la boulangerie */}
|
||||||
<SidebarHeader>
|
<SidebarHeader>
|
||||||
<SidebarMenu>
|
<SidebarMenu>
|
||||||
<SidebarMenuItem>
|
<SidebarMenuItem>
|
||||||
<SidebarMenuButton
|
<SidebarMenuButton
|
||||||
asChild
|
|
||||||
size="lg"
|
size="lg"
|
||||||
tooltip="Le Fournil du Bocage"
|
tooltip="Le Fournil du Bocage"
|
||||||
>
|
onClick={handleCloseMenu}
|
||||||
|
render={
|
||||||
<Link
|
<Link
|
||||||
to="/"
|
to="/"
|
||||||
className="flex items-center gap-2"
|
className="flex w-full items-center gap-2"
|
||||||
onClick={handleCloseMenu}
|
|
||||||
>
|
>
|
||||||
<div className="flex aspect-square size-8 shrink-0 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground">
|
<div className="flex aspect-square size-8 shrink-0 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground">
|
||||||
<Wheat className="size-4" />
|
<Wheat className="size-4" />
|
||||||
@ -122,7 +119,8 @@ const NavBar = () => {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
</SidebarMenuButton>
|
}
|
||||||
|
/>
|
||||||
</SidebarMenuItem>
|
</SidebarMenuItem>
|
||||||
</SidebarMenu>
|
</SidebarMenu>
|
||||||
</SidebarHeader>
|
</SidebarHeader>
|
||||||
@ -130,7 +128,7 @@ const NavBar = () => {
|
|||||||
{/* Navigation */}
|
{/* Navigation */}
|
||||||
<SidebarContent>
|
<SidebarContent>
|
||||||
<SidebarGroup>
|
<SidebarGroup>
|
||||||
<SidebarGroupLabel>
|
<SidebarGroupLabel className="text-lg">
|
||||||
Navigation
|
Navigation
|
||||||
</SidebarGroupLabel>
|
</SidebarGroupLabel>
|
||||||
|
|
||||||
@ -142,21 +140,22 @@ const NavBar = () => {
|
|||||||
return (
|
return (
|
||||||
<SidebarMenuItem key={item.href}>
|
<SidebarMenuItem key={item.href}>
|
||||||
<SidebarMenuButton
|
<SidebarMenuButton
|
||||||
asChild
|
|
||||||
tooltip={item.title}
|
tooltip={item.title}
|
||||||
>
|
onClick={handleCloseMenu}
|
||||||
|
className="w-full"
|
||||||
|
render={
|
||||||
<NavLink
|
<NavLink
|
||||||
to={item.href}
|
to={item.href}
|
||||||
className="flex items-center gap-2"
|
className="flex w-full items-center gap-2 text-base"
|
||||||
onClick={handleCloseMenu}
|
|
||||||
>
|
>
|
||||||
<Icon className="size-4 shrink-0" />
|
<Icon className="size-6 shrink-0" />
|
||||||
|
|
||||||
<span className="truncate">
|
<span className="truncate text-base">
|
||||||
{item.title}
|
{item.title}
|
||||||
</span>
|
</span>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</SidebarMenuButton>
|
}
|
||||||
|
/>
|
||||||
</SidebarMenuItem>
|
</SidebarMenuItem>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
@ -167,7 +166,7 @@ const NavBar = () => {
|
|||||||
{/* Administration */}
|
{/* Administration */}
|
||||||
{user.is_admin && (
|
{user.is_admin && (
|
||||||
<SidebarGroup>
|
<SidebarGroup>
|
||||||
<SidebarGroupLabel>
|
<SidebarGroupLabel className="text-lg">
|
||||||
Administration
|
Administration
|
||||||
</SidebarGroupLabel>
|
</SidebarGroupLabel>
|
||||||
|
|
||||||
@ -175,27 +174,27 @@ const NavBar = () => {
|
|||||||
<SidebarMenu>
|
<SidebarMenu>
|
||||||
<SidebarMenuItem>
|
<SidebarMenuItem>
|
||||||
<SidebarMenuButton
|
<SidebarMenuButton
|
||||||
asChild
|
|
||||||
tooltip="Comptes existants"
|
tooltip="Comptes existants"
|
||||||
>
|
onClick={handleCloseMenu}
|
||||||
|
className="w-full"
|
||||||
|
render={
|
||||||
<NavLink
|
<NavLink
|
||||||
to="/users"
|
to="/users"
|
||||||
className="flex items-center gap-2"
|
className="flex w-full items-center gap-2 text-base"
|
||||||
onClick={handleCloseMenu}
|
|
||||||
>
|
>
|
||||||
<Users className="size-4 shrink-0" />
|
<Users className="size-6 shrink-0" />
|
||||||
|
|
||||||
<span className="truncate">
|
<span className="truncate text-base">
|
||||||
Comptes existants
|
Comptes existants
|
||||||
</span>
|
</span>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</SidebarMenuButton>
|
}
|
||||||
|
/>
|
||||||
</SidebarMenuItem>
|
</SidebarMenuItem>
|
||||||
</SidebarMenu>
|
</SidebarMenu>
|
||||||
</SidebarGroupContent>
|
</SidebarGroupContent>
|
||||||
</SidebarGroup>
|
</SidebarGroup>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
</SidebarContent>
|
</SidebarContent>
|
||||||
|
|
||||||
{/* Déconnexion */}
|
{/* Déconnexion */}
|
||||||
@ -203,16 +202,23 @@ const NavBar = () => {
|
|||||||
<SidebarMenu>
|
<SidebarMenu>
|
||||||
<SidebarMenuItem>
|
<SidebarMenuItem>
|
||||||
<SidebarMenuButton
|
<SidebarMenuButton
|
||||||
onClick={logout}
|
|
||||||
tooltip="Déconnexion"
|
tooltip="Déconnexion"
|
||||||
className="flex items-center gap-2"
|
onClick={handleCloseMenu}
|
||||||
|
className="w-full"
|
||||||
|
render={
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={logout}
|
||||||
|
className="flex w-full items-center gap-2 text-base"
|
||||||
>
|
>
|
||||||
<LogOut className="size-4 shrink-0" />
|
<LogOut className="size-6 shrink-0" />
|
||||||
|
|
||||||
<span className="truncate">
|
<span className="truncate text-base">
|
||||||
Déconnexion
|
Déconnexion
|
||||||
</span>
|
</span>
|
||||||
</SidebarMenuButton>
|
</button>
|
||||||
|
}
|
||||||
|
/>
|
||||||
</SidebarMenuItem>
|
</SidebarMenuItem>
|
||||||
</SidebarMenu>
|
</SidebarMenu>
|
||||||
</SidebarFooter>
|
</SidebarFooter>
|
||||||
|
|||||||
@ -29,7 +29,7 @@ const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
|
|||||||
const SIDEBAR_WIDTH = "16rem"
|
const SIDEBAR_WIDTH = "16rem"
|
||||||
const SIDEBAR_WIDTH_MOBILE = "18rem"
|
const SIDEBAR_WIDTH_MOBILE = "18rem"
|
||||||
const SIDEBAR_WIDTH_ICON = "3rem"
|
const SIDEBAR_WIDTH_ICON = "3rem"
|
||||||
const SIDEBAR_KEYBOARD_SHORTCUT = "b"
|
const SIDEBAR_KEYBOARD_SHORTCUT = null
|
||||||
|
|
||||||
const SidebarContext = React.createContext(null)
|
const SidebarContext = React.createContext(null)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user