Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced Empty Div With Avatar When SideBar is Closed #9855

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/components/ui/sidebar/nav-main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
useSidebar,
} from "@/components/ui/sidebar";

import { Avatar } from "@/components/Common/Avatar";

export function NavMain({
links,
}: {
Expand Down Expand Up @@ -45,8 +47,16 @@ export function NavMain({
activeClass="bg-white text-green-700 shadow"
exactActiveClass="bg-white text-green-700 shadow"
>
{link.icon && <CareIcon icon={link.icon as IconName} />}
<span className="group-data-[collapsible=icon]:hidden">
{link.icon ? (
<CareIcon icon={link.icon as IconName} />
) : (
<Avatar
Copy link
Contributor

@Jacobjeevan Jacobjeevan Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Why add Avatar here? It wouldn't make any sense to do so. Just add icons to the relevant sidebar links instead (you can find icons at /icons if you want to hunt for relevant ones).

Copy link
Contributor Author

@AnveshNalimela AnveshNalimela Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jacobjeevan What if user associated with Multiple organizations. If we add an icon it would same for multiple organizations. Doesnt make any distinction.

name={link.name}
className="w-6 h-6 -m-1 rounded-sm"
/>
)}

<span className="group-data-[collapsible=icon]:hidden ml-1">
{link.name}
</span>
</ActiveLink>
Expand Down
Loading