[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:
parent
976784bc84
commit
3279bb6ac9
1 changed files with 13 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue