From b5fa0e280bff2e75f4dedd505609fdc477bb3fd9 Mon Sep 17 00:00:00 2001 From: lizerk Date: Mon, 13 Apr 2026 15:41:09 +0300 Subject: [PATCH] refactor(frontend): move comments above detail blocks --- frontend/src/app/procurement/page.tsx | 54 ++++++------- .../components/requests/RequestListItem.tsx | 78 +++++++++---------- 2 files changed, 66 insertions(+), 66 deletions(-) diff --git a/frontend/src/app/procurement/page.tsx b/frontend/src/app/procurement/page.tsx index c2dfe7f9..ee4fad88 100644 --- a/frontend/src/app/procurement/page.tsx +++ b/frontend/src/app/procurement/page.tsx @@ -829,33 +829,6 @@ export default function ProcurementPage() { {(expanded || commentsOpen) && (
- {expanded ? ( - - )} - /> - ) : null} - {commentsOpen ? (
@@ -893,6 +866,33 @@ export default function ProcurementPage() {
) : null} + + {expanded ? ( + + )} + /> + ) : null}
)} diff --git a/frontend/src/components/requests/RequestListItem.tsx b/frontend/src/components/requests/RequestListItem.tsx index fc69b8d1..e18bffd0 100644 --- a/frontend/src/components/requests/RequestListItem.tsx +++ b/frontend/src/components/requests/RequestListItem.tsx @@ -304,8 +304,46 @@ export function RequestListItem({ {(rowOpen || commentsOpen) ? (
+ {commentsOpen ? ( +
+
+ {comments.length === 0 ? ( +

Комментариев пока нет

+ ) : ( + comments.map((comment) => ( +
+
+ {displayUserName(comment.author)} +
+ {formatDate(comment.created_at)} + {Boolean(comment.author?.id && currentUserId === comment.author.id) ? ( + onDeleteComment(request.id, comment.id)} + /> + ) : null} +
+
+

{comment.text}

+
+ )) + )} +
+
+ onSetCommentDraft(request.id, value)} + onSubmit={() => onAddComment(request.id)} + disabled={busyKey === `comment-${request.id}`} + /> +
+
+ ) : null} + {rowOpen ? ( -
+
Принял решение:{" "} @@ -387,44 +425,6 @@ export function RequestListItem({
) : null} - - {commentsOpen ? ( -
-
- {comments.length === 0 ? ( -

Комментариев пока нет

- ) : ( - comments.map((comment) => ( -
-
- {displayUserName(comment.author)} -
- {formatDate(comment.created_at)} - {Boolean(comment.author?.id && currentUserId === comment.author.id) ? ( - onDeleteComment(request.id, comment.id)} - /> - ) : null} -
-
-

{comment.text}

-
- )) - )} -
-
- onSetCommentDraft(request.id, value)} - onSubmit={() => onAddComment(request.id)} - disabled={busyKey === `comment-${request.id}`} - /> -
-
- ) : null}
) : null}