logout button bug fixed
This commit is contained in:
@@ -5,13 +5,17 @@ const SubMenuLink = ({
|
|||||||
logOut,
|
logOut,
|
||||||
}: {
|
}: {
|
||||||
item: MenuItem;
|
item: MenuItem;
|
||||||
logOut: () => void;
|
logOut?: () => void;
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
className="flex flex-row gap-4 rounded-md p-3 leading-none no-underline transition-colors outline-none select-none hover:bg-muted hover:text-accent-foreground"
|
className="flex flex-row gap-4 rounded-md p-3 leading-none no-underline transition-colors outline-none select-none hover:bg-muted hover:text-accent-foreground"
|
||||||
href={item.url}
|
href={item.url}
|
||||||
onClick={logOut}
|
onClick={() => {
|
||||||
|
if (logOut) {
|
||||||
|
logOut();
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div className="text-foreground">
|
<div className="text-foreground">
|
||||||
{item.icon && <item.icon className="size-5 shrink-0" />}
|
{item.icon && <item.icon className="size-5 shrink-0" />}
|
||||||
|
|||||||
Reference in New Issue
Block a user