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_TOKEN_URL=
|
||||||
OAUTH_USERINFO_URL=
|
OAUTH_USERINFO_URL=
|
||||||
OAUTH_JWKS_ENDPOINT=
|
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}
|
icon={item.icon}
|
||||||
setOpen={setSidebarIsOpen}
|
setOpen={setSidebarIsOpen}
|
||||||
showTitle={sidebarIsOpen}
|
showTitle={sidebarIsOpen}
|
||||||
|
isMobile={isMobile}
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
|
@ -8,6 +8,7 @@ export type SidebarItemProps = {
|
|||||||
href: string;
|
href: string;
|
||||||
setOpen: (open: boolean) => void;
|
setOpen: (open: boolean) => void;
|
||||||
showTitle: boolean;
|
showTitle: boolean;
|
||||||
|
isMobile: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SidebarItem = ({
|
export const SidebarItem = ({
|
||||||
@ -16,6 +17,7 @@ export const SidebarItem = ({
|
|||||||
href,
|
href,
|
||||||
setOpen,
|
setOpen,
|
||||||
showTitle = true,
|
showTitle = true,
|
||||||
|
isMobile
|
||||||
}: SidebarItemProps) => {
|
}: SidebarItemProps) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
@ -23,7 +25,7 @@ export const SidebarItem = ({
|
|||||||
<Link
|
<Link
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
router.push(href);
|
router.push(href);
|
||||||
setOpen(false);
|
if (isMobile) setOpen(false);
|
||||||
}}
|
}}
|
||||||
color="foreground"
|
color="foreground"
|
||||||
className="w-full p-2 gap-3 text-md"
|
className="w-full p-2 gap-3 text-md"
|
||||||
|
Loading…
Reference in New Issue
Block a user