feature/IO-3291-Tasks-Notifications: Checkpoint
This commit is contained in:
@@ -2,11 +2,10 @@ import { Virtuoso } from "react-virtuoso";
|
||||
import { Badge, Spin, Typography } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { forwardRef, useMemo, useRef } from "react";
|
||||
import { DateTimeFormat } from "../../utils/DateFormatter.jsx";
|
||||
import day from "../../utils/day.js";
|
||||
import "./task-center.styles.scss";
|
||||
|
||||
const { Text, Title } = Typography;
|
||||
const { Title } = Typography;
|
||||
|
||||
const TaskCenterComponent = forwardRef(({ visible, tasks, loading, onTaskClick, onLoadMore, totalTasks }, ref) => {
|
||||
const { t } = useTranslation();
|
||||
@@ -51,31 +50,30 @@ const TaskCenterComponent = forwardRef(({ visible, tasks, loading, onTaskClick,
|
||||
const priorityColor = getPriorityColor(task.priority);
|
||||
|
||||
return (
|
||||
<div key={`${task.id}-${index}`} className="task-item task-incomplete" onClick={handleClick}>
|
||||
<Badge dot color={priorityColor || undefined} style={priorityColor ? {} : { display: "none" }}>
|
||||
<div key={`${task.id}-${index}`} className="task-item" onClick={handleClick}>
|
||||
<Badge color={priorityColor || undefined} dot={!!priorityColor} offset={[-4, 4]}>
|
||||
<div className="task-content">
|
||||
<Text strong className="task-body">
|
||||
{task.title}
|
||||
</Text>
|
||||
|
||||
<div className="task-meta">
|
||||
<div className="ro-number">
|
||||
{t("notifications.labels.ro-number", {
|
||||
ro_number: task.job?.ro_number || t("general.labels.na")
|
||||
})}
|
||||
</div>
|
||||
<div className="task-header-row">
|
||||
<span className="task-title">{task.title}</span>
|
||||
{task.due_date && (
|
||||
<Text type="secondary" className="relative-time" title={DateTimeFormat(task.due_date)}>
|
||||
{day(task.due_date).fromNow()}
|
||||
</Text>
|
||||
<span className="task-due-date">
|
||||
{t("tasks.labels.due")}: {day(task.due_date).fromNow()}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/*{task.description && <div className="task-description">{task.description}</div>}*/}
|
||||
|
||||
<div className="task-ro-number">
|
||||
{t("notifications.labels.ro-number", {
|
||||
ro_number: task.job?.ro_number || t("general.labels.na")
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</Badge>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const renderItem = (index, item) => {
|
||||
if (item.type === "header") {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user