From 1adef8fbf08da4ee3c32ebbf9912bbf33708caed Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Mon, 9 Sep 2024 15:49:40 +0530 Subject: [PATCH 1/5] chore: sidebar hover effect disabled for pwa --- .../sidebar/favorites/favorites-menu.tsx | 10 ++++-- .../workspace/sidebar/projects-list-item.tsx | 33 ++++++++--------- .../workspace/sidebar/projects-list.tsx | 13 +++++-- .../workspace/sidebar/workspace-menu.tsx | 35 ++++++++++++------- 4 files changed, 54 insertions(+), 37 deletions(-) diff --git a/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx b/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx index f7b620f7a49..935c5e214a1 100644 --- a/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx +++ b/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx @@ -124,16 +124,22 @@ export const SidebarFavoritesMenu = observer(() => { ref={elementRef} as="button" className={cn( - "sticky top-0 bg-custom-sidebar-background-100 z-10 group/workspace-button w-full px-2 py-1.5 flex items-center justify-between gap-1 text-custom-sidebar-text-400 hover:bg-custom-sidebar-background-90 rounded text-xs font-semibold", + "sticky top-0 bg-custom-sidebar-background-100 z-10 w-full px-2 py-1.5 flex items-center justify-between gap-1 text-custom-sidebar-text-400 rounded text-xs font-semibold", { "bg-custom-sidebar-background-80 opacity-60": isDragging, + "group/workspace-button hover:bg-custom-sidebar-background-90": !isMobile, } )} > toggleFavoriteMenu(!isFavoriteMenuOpen)} className="flex-1 text-start"> YOUR FAVORITES - + { diff --git a/web/core/components/workspace/sidebar/projects-list-item.tsx b/web/core/components/workspace/sidebar/projects-list-item.tsx index c232baa8b4e..977feab96a6 100644 --- a/web/core/components/workspace/sidebar/projects-list-item.tsx +++ b/web/core/components/workspace/sidebar/projects-list-item.tsx @@ -301,13 +301,11 @@ export const SidebarProjectsListItem: React.FC = observer((props) => { >
{!disableDrag && ( @@ -385,12 +383,11 @@ export const SidebarProjectsListItem: React.FC = observer((props) => { } - 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("flex-shrink-0 pointer-events-auto", { + "opacity-100 pointer-events-auto": isMenuActive, + "opacity-0 pointer-events-none group-hover/project-item:opacity-100 group-hover/project-item:pointer-events-auto": + !isMobile, + })} customButtonClassName="grid place-items-center" placement="bottom-start" useCaptureForOutsideClick @@ -468,12 +465,10 @@ export const SidebarProjectsListItem: React.FC = observer((props) => { setIsProjectListOpen(!isProjectListOpen)} > { // get local storage data for isFavoriteProjectsListOpen and isAllProjectsListOpen @@ -40,6 +41,7 @@ export const SidebarProjectsList: FC = observer(() => { const { membership: { currentWorkspaceRole }, } = useUser(); + const { isMobile } = usePlatformOS(); const { getProjectById, joinedProjectIds: joinedProjects, updateProjectView } = useProject(); // router params const { workspaceSlug } = useParams(); @@ -155,10 +157,11 @@ export const SidebarProjectsList: FC = observer(() => {
@@ -166,7 +169,7 @@ export const SidebarProjectsList: FC = observer(() => { as="button" type="button" className={cn( - "group w-full flex items-center gap-1 whitespace-nowrap text-left text-sm font-semibold text-custom-sidebar-text-400", + "w-full flex items-center gap-1 whitespace-nowrap text-left text-sm font-semibold text-custom-sidebar-text-400", { "!text-center w-8 px-2 py-1.5 justify-center": isCollapsed, } @@ -184,7 +187,11 @@ export const SidebarProjectsList: FC = observer(() => { {!isCollapsed && ( -
+
{isAuthorizedUser && (