Skip to content

Commit

Permalink
chore: tweaks for the new sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
paabloLC committed Mar 3, 2025
1 parent 55d976c commit bb38da6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
16 changes: 8 additions & 8 deletions ui/components/ui/sidebar-new/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ import { Button } from "../button/button";
import { CustomButton } from "../custom/custom-button";
import { ScrollArea } from "../scroll-area/scroll-area";

interface MenuProps {
isOpen: boolean | undefined;
}

export function Menu({ isOpen }: MenuProps) {
export const Menu = ({ isOpen }: { isOpen: boolean }) => {
const pathname = usePathname();
const menuList = getMenuList(pathname);

Expand All @@ -45,10 +41,14 @@ export function Menu({ isOpen }: MenuProps) {
</div>
<ScrollArea className="[&>div>div[style]]:!block">
<nav className="mt-2 h-full w-full lg:mt-6">
<ul className="flex min-h-[calc(100vh-48px-36px-16px-32px)] flex-col items-start space-y-1 px-2 lg:min-h-[calc(100vh-32px-40px-32px)]">
<ul className="flex min-h-[calc(100vh-16px-60px-40px-16px-32px-40px-32px)] flex-col items-start space-y-1 px-2 lg:min-h-[calc(100vh-16px-60px-40px-16px-64px-16px)]">
{menuList.map(({ groupLabel, menus }, index) => (
<li
className={cn("w-full", groupLabel ? "pt-2" : "")}
className={cn(
"w-full",
groupLabel ? "pt-2" : "",
"last:!mt-auto",
)}
key={index}
>
{(isOpen && groupLabel) || isOpen === undefined ? (
Expand Down Expand Up @@ -168,4 +168,4 @@ export function Menu({ isOpen }: MenuProps) {
</div>
</>
);
}
};
10 changes: 4 additions & 6 deletions ui/components/ui/user-nav/user-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ import { UserProfileProps } from "@/types";

import { Button } from "../button/button";

export function UserNav({ user }: { user: UserProfileProps }) {
const { data } = user;
export const UserNav = ({ user }: { user?: UserProfileProps }) => {
if (!user || !user.data) return null;

if (!data) return null;

const { name, email, company_name } = data.attributes;
const { name, email, company_name } = user.data.attributes;

return (
<DropdownMenu>
Expand Down Expand Up @@ -97,4 +95,4 @@ export function UserNav({ user }: { user: UserProfileProps }) {
</DropdownMenuContent>
</DropdownMenu>
);
}
};

0 comments on commit bb38da6

Please sign in to comment.