feat: update Sidebar component to handle mobile state; modify SidebarItem to close on mobile navigation
This commit is contained in:
parent
a23b58e05c
commit
4606be56a0
@ -10,4 +10,4 @@ OAUTH_AUTHORIZATION_URL=
|
||||
OAUTH_TOKEN_URL=
|
||||
OAUTH_USERINFO_URL=
|
||||
OAUTH_JWKS_ENDPOINT=
|
||||
OAUTH_SCOPES="openid email profile offline_access"
|
||||
OAUTH_SCOPES="openid email profile"
|
@ -107,6 +107,7 @@ export const Sidebar = ({
|
||||
icon={item.icon}
|
||||
setOpen={setSidebarIsOpen}
|
||||
showTitle={sidebarIsOpen}
|
||||
isMobile={isMobile}
|
||||
/>
|
||||
</li>
|
||||
))}
|
||||
|
@ -8,6 +8,7 @@ export type SidebarItemProps = {
|
||||
href: string;
|
||||
setOpen: (open: boolean) => void;
|
||||
showTitle: boolean;
|
||||
isMobile: boolean;
|
||||
};
|
||||
|
||||
export const SidebarItem = ({
|
||||
@ -16,6 +17,7 @@ export const SidebarItem = ({
|
||||
href,
|
||||
setOpen,
|
||||
showTitle = true,
|
||||
isMobile
|
||||
}: SidebarItemProps) => {
|
||||
const router = useRouter();
|
||||
|
||||
@ -23,13 +25,13 @@ export const SidebarItem = ({
|
||||
<Link
|
||||
onPress={() => {
|
||||
router.push(href);
|
||||
setOpen(false);
|
||||
if (isMobile) setOpen(false);
|
||||
}}
|
||||
color="foreground"
|
||||
className="w-full p-2 gap-3 text-md"
|
||||
>
|
||||
<span className="text-xl">{icon}</span>
|
||||
{showTitle && <span className="text-sm">{title}</span>}
|
||||
{showTitle && <span className="text-sm">{title}</span>}
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user