From 725c94c89423d7db86a9ae316c6a5ff345f44365 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Wed, 7 Aug 2024 17:06:34 +0530 Subject: [PATCH 1/2] fix: user favorties item icon type and alignment --- .../sidebar/favorites/favorite-folder.tsx | 2 +- .../sidebar/favorites/favorite-item.tsx | 26 +++++++++---------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/web/core/components/workspace/sidebar/favorites/favorite-folder.tsx b/web/core/components/workspace/sidebar/favorites/favorite-folder.tsx index 55ed717e3c3..046bd4f81fc 100644 --- a/web/core/components/workspace/sidebar/favorites/favorite-folder.tsx +++ b/web/core/components/workspace/sidebar/favorites/favorite-folder.tsx @@ -240,7 +240,7 @@ export const FavoriteFolder: React.FC = (props) => { -
+

{favorite.name}

diff --git a/web/core/components/workspace/sidebar/favorites/favorite-item.tsx b/web/core/components/workspace/sidebar/favorites/favorite-item.tsx index f824fc493f3..ffcffd9db31 100644 --- a/web/core/components/workspace/sidebar/favorites/favorite-item.tsx +++ b/web/core/components/workspace/sidebar/favorites/favorite-item.tsx @@ -9,17 +9,9 @@ import { useParams } from "next/navigation"; import { Briefcase, FileText, Layers, MoreHorizontal, Star } from "lucide-react"; // ui import { IFavorite } from "@plane/types"; -import { - ContrastIcon, - CustomMenu, - DiceIcon, - DragHandle, - FavoriteFolderIcon, - LayersIcon, - Logo, - Tooltip, -} from "@plane/ui"; +import { ContrastIcon, CustomMenu, DiceIcon, DragHandle, FavoriteFolderIcon, LayersIcon, Tooltip } from "@plane/ui"; // components +import { Logo } from "@/components/common"; import { SidebarNavItem } from "@/components/sidebar"; // helpers @@ -70,10 +62,16 @@ export const FavoriteItem = observer( const getIcon = () => ( <> -
{ICONS[favorite.entity_type] || }
-
+
+ {ICONS[favorite.entity_type] || } +
+
{favorite.entity_data?.logo_props?.in_use ? ( - + ) : ( ICONS[favorite.entity_type] || )} @@ -176,7 +174,7 @@ export const FavoriteItem = observer( - {getIcon()} +
{getIcon()}
{!sidebarCollapsed && ( {favorite.entity_data ? favorite.entity_data.name : favorite.name} From 49325d2c9f4ec8e9ae9c309c7b5a949e3b07f63c Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Wed, 7 Aug 2024 17:42:46 +0530 Subject: [PATCH 2/2] chore: user favorite item clickable area improvement --- .../sidebar/favorites/favorite-item.tsx | 100 +++++++++--------- 1 file changed, 51 insertions(+), 49 deletions(-) diff --git a/web/core/components/workspace/sidebar/favorites/favorite-item.tsx b/web/core/components/workspace/sidebar/favorites/favorite-item.tsx index ffcffd9db31..348b5c76e75 100644 --- a/web/core/components/workspace/sidebar/favorites/favorite-item.tsx +++ b/web/core/components/workspace/sidebar/favorites/favorite-item.tsx @@ -138,18 +138,27 @@ export const FavoriteItem = observer( useOutsideClickDetector(actionSectionRef, () => setIsMenuActive(false)); return ( -
- + <> + {sidebarCollapsed ? ( +
+ + {getIcon()} + +
+ ) : (
- - +
{getIcon()}
- {!sidebarCollapsed && ( - - {favorite.entity_data ? favorite.entity_data.name : favorite.name} - - )} + + {favorite.entity_data ? favorite.entity_data.name : favorite.name} + - - {!sidebarCollapsed && ( - setIsMenuActive(!isMenuActive)} - > - - + setIsMenuActive(!isMenuActive)} + > + + + } + className={cn( + "opacity-0 pointer-events-none flex-shrink-0 group-hover/project-item:opacity-100 group-hover/project-item:pointer-events-auto", + { + "opacity-100 pointer-events-auto": isMenuActive, } - className={cn( - "opacity-0 pointer-events-none flex-shrink-0 group-hover/project-item:opacity-100 group-hover/project-item:pointer-events-auto", - { - "opacity-100 pointer-events-auto": isMenuActive, - } - )} - customButtonClassName="grid place-items-center" - placement="bottom-start" - > - handleRemoveFromFavorites(favorite)}> - - - Remove from favorites - - - - )} + )} + customButtonClassName="grid place-items-center" + placement="bottom-start" + > + handleRemoveFromFavorites(favorite)}> + + + Remove from favorites + + +
-
-
+ )} + ); } );