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
11 changes: 7 additions & 4 deletions web/core/components/core/list/list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { cn } from "@/helpers/common.helper";
import { useAppRouter } from "@/hooks/use-app-router";

interface IListItemProps {
id?: string;
title: string;
itemLink: string;
onItemClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
Expand All @@ -22,10 +23,12 @@ interface IListItemProps {
actionItemContainerClassName?: string;
isSidebarOpen?: boolean;
quickActionElement?: JSX.Element;
preventDefaultNProgress?: boolean;
}

export const ListItem: FC<IListItemProps> = (props) => {
const {
id,
title,
prependTitleElement,
appendTitleElement,
Expand All @@ -40,6 +43,7 @@ export const ListItem: FC<IListItemProps> = (props) => {
isSidebarOpen = false,
quickActionElement,
itemClassName = "",
preventDefaultNProgress = false,
} = props;

// router
Expand All @@ -56,20 +60,19 @@ export const ListItem: FC<IListItemProps> = (props) => {
<Row
className={cn(
"group min-h-[52px] flex w-full flex-col items-center justify-between gap-3 py-4 text-sm border-b border-custom-border-200 bg-custom-background-100 hover:bg-custom-background-90 ",
{
"xl:gap-5 xl:py-0 xl:flex-row": isSidebarOpen,
"lg:gap-5 lg:py-0 lg:flex-row": !isSidebarOpen,
},
{ "xl:gap-5 xl:py-0 xl:flex-row": isSidebarOpen, "lg:gap-5 lg:py-0 lg:flex-row": !isSidebarOpen },
className
)}
>
<div className={cn("relative flex w-full items-center justify-between gap-3 overflow-hidden", itemClassName)}>
<ControlLink
id={id}
className="relative flex w-full items-center gap-3 overflow-hidden"
href={itemLink}
target="_self"
onClick={handleControlLinkClick}
disabled={disableLink}
data-prevent-nprogress={preventDefaultNProgress}
>
<div className="flex items-center gap-4 truncate">
{prependTitleElement && <span className="flex items-center flex-shrink-0">{prependTitleElement}</span>}
Expand Down
2 changes: 2 additions & 0 deletions web/core/components/home/widgets/recents/issue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const RecentIssue = (props: BlockProps) => {
return (
<ListItem
key={activity.id}
id={`issue-${issueDetails?.id}`}
itemLink={workItemLink}
title={issueDetails?.name}
prependTitleElement={
Expand Down Expand Up @@ -113,6 +114,7 @@ export const RecentIssue = (props: BlockProps) => {
e.stopPropagation();
setPeekIssue({ workspaceSlug, projectId: issueDetails?.project_id, issueId: activity.entity_data.id });
}}
preventDefaultNProgress
/>
);
};