Skip to content

Commit

Permalink
chore: helper function added and code refactor (#6419)
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolsinghbhatia authored Jan 17, 2025
1 parent 00cc338 commit 9ae1ce0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions web/ce/components/issues/issue-layouts/issue-stats.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"use client";

import React, { FC } from "react";

type Props = {
issueId: string;
};

export const IssueStats: FC<Props> = (props) => {
const { issueId } = props;
return <></>;
};
2 changes: 2 additions & 0 deletions web/core/components/issues/issue-layouts/list/block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { TSelectionHelper } from "@/hooks/use-multiple-select";
import { usePlatformOS } from "@/hooks/use-platform-os";
// plane web components
import { IssueIdentifier } from "@/plane-web/components/issues";
import { IssueStats } from "@/plane-web/components/issues/issue-layouts/issue-stats";
// types
import { TRenderQuickActions } from "./list-view-types";

Expand Down Expand Up @@ -276,6 +277,7 @@ export const IssueBlock = observer((props: IssueBlockProps) => {
<div className="flex flex-shrink-0 items-center gap-2">
{!issue?.tempId ? (
<>
{isEpic && <IssueStats issueId={issue.id} />}
<IssueProperties
className={`relative flex flex-wrap ${isSidebarCollapsed ? "md:flex-grow md:flex-shrink-0" : "lg:flex-grow lg:flex-shrink-0"} items-center gap-2 whitespace-nowrap`}
issue={issue}
Expand Down
3 changes: 3 additions & 0 deletions web/helpers/common.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ export const debounce = (func: any, wait: number, immediate: boolean = false) =>
export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs));

export const convertRemToPixel = (rem: number): number => rem * 0.9 * 16;

export const getProgress = (completed: number | undefined, total: number | undefined) =>
total && total > 0 ? Math.round(((completed ?? 0) / total) * 100) : 0;

0 comments on commit 9ae1ce0

Please sign in to comment.