Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ import { useAppTheme } from "@/hooks/store";
import { usePlatformOS } from "@/hooks/use-platform-os";

type Props = {
projectId: string | null;
href: string;
title: string;
icon: JSX.Element;
isSidebarCollapsed: boolean;
};

export const FavoriteItemTitle: FC<Props> = observer((props) => {
const { projectId, href, title, icon, isSidebarCollapsed } = props;
const { href, title, icon, isSidebarCollapsed } = props;
// store hooks
const { toggleSidebar } = useAppTheme();
const { isMobile } = usePlatformOS();
Expand All @@ -24,10 +23,6 @@ export const FavoriteItemTitle: FC<Props> = observer((props) => {
"group/project-item cursor-pointer relative group w-full flex items-center justify-center gap-1.5 rounded px-2 py-1 outline-none text-custom-sidebar-text-200 hover:bg-custom-sidebar-background-90 active:bg-custom-sidebar-background-90 truncate p-0 size-8 aspect-square mx-auto";

const handleOnClick = () => {
if (projectId) {
const projectItem = document.getElementById(`${projectId}`);
projectItem?.scrollIntoView({ behavior: "smooth" });
}
if (isMobile) toggleSidebar();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,7 @@ export const FavoriteRoot: FC<Props> = observer((props) => {
<>
<FavoriteItemWrapper elementRef={elementRef} isMenuActive={isMenuActive} sidebarCollapsed={sidebarCollapsed}>
{!sidebarCollapsed && <FavoriteItemDragHandle isDragging={isDragging} sort_order={favorite.sort_order} />}
<FavoriteItemTitle
href={itemLink}
projectId={favorite.project_id}
icon={itemIcon}
title={itemTitle}
isSidebarCollapsed={!!sidebarCollapsed}
/>
<FavoriteItemTitle href={itemLink} icon={itemIcon} title={itemTitle} isSidebarCollapsed={!!sidebarCollapsed} />
{!sidebarCollapsed && (
<FavoriteItemQuickAction
favorite={favorite}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ export const SidebarProjectsListItem: React.FC<Props> = observer((props) => {

useEffect(() => {
if (URLProjectId === project.id) setIsProjectListOpen(true);
else setIsProjectListOpen(false);
}, [URLProjectId]);

const handleItemClick = () => {
Expand Down