[WEB-2182] fix: favorite item alignment and redirection (#5316)

* fix: favorite item alignment

* fix: favorite item redirection

* chore: code refactor
This commit is contained in:
Anmol Singh Bhatia 2024-08-06 18:21:53 +05:30 committed by GitHub
parent 976784bc84
commit 3279bb6ac9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -135,7 +135,11 @@ export const FavoriteItem = observer(
key={favorite.id}
className={`${sidebarCollapsed ? "p-0 size-8 aspect-square justify-center mx-auto" : ""}`}
>
<div className="flex flex-between items-center gap-1.5 py-[1px] w-full">
<div
className={cn("flex justify-between items-center gap-1.5 py-[1px]", {
"w-full": !sidebarCollapsed,
})}
>
<Tooltip
isMobile={isMobile}
tooltipContent={favorite.sort_order === null ? "Join the project to rearrange" : "Drag to rearrange"}
@ -158,13 +162,14 @@ export const FavoriteItem = observer(
</button>
</Tooltip>
{getIcon()}
{!sidebarCollapsed && (
<Link href={getLink()} className="text-sm leading-5 font-medium flex-1 truncate">
{favorite.entity_data ? favorite.entity_data.name : favorite.name}
</Link>
)}
<Link href={getLink()} className="flex items-center gap-1.5 truncate">
{getIcon()}
{!sidebarCollapsed && (
<span className="text-sm leading-5 font-medium flex-1 truncate">
{favorite.entity_data ? favorite.entity_data.name : favorite.name}
</span>
)}
</Link>
{!sidebarCollapsed && (
<CustomMenu