From 6ad89e4f4f73ae70a865cb7b61654e68bb0df994 Mon Sep 17 00:00:00 2001 From: Thanush19 <110150744+Thanush19@users.noreply.github.com> Date: Fri, 8 Mar 2024 20:13:06 +0530 Subject: [PATCH 1/6] fix ui layout of comment-box in shift page --- src/Components/Shifting/CommentsSection.tsx | 98 ++++++++++++--------- src/Components/Shifting/ShiftDetails.tsx | 32 +++++-- 2 files changed, 82 insertions(+), 48 deletions(-) diff --git a/src/Components/Shifting/CommentsSection.tsx b/src/Components/Shifting/CommentsSection.tsx index 767ab402265..0da9793f0b2 100644 --- a/src/Components/Shifting/CommentsSection.tsx +++ b/src/Components/Shifting/CommentsSection.tsx @@ -9,10 +9,63 @@ import { IComment } from "../Resource/models"; import PaginatedList from "../../CAREUI/misc/PaginatedList"; import request from "../../Utils/request/request"; -interface CommentSectionProps { +interface CommentProps { id: string; + comment: string; + created_by_object: any; + modified_date: string; } -const CommentSection = (props: CommentSectionProps) => { + +const Comment = ({ + id, + comment, + created_by_object, + modified_date, +}: CommentProps) => { + const { t } = useTranslation(); + const [expanded, setExpanded] = useState(false); + + const toggleExpanded = () => { + setExpanded(!expanded); + }; + + const truncatedComment = comment.split(" ").slice(0, 20).join(" "); + const remainingComment = comment.split(" ").slice(20).join(" "); + + return ( +
+ {expanded ? comment : truncatedComment} + {!expanded && remainingComment && ( + + )} +
+{expanded ? comment : truncatedComment} {!expanded && remainingComment && ( -
From c56ac797d81263a238e12fc5f25761a58f6fd464 Mon Sep 17 00:00:00 2001 From: Thanush19 <110150744+Thanush19@users.noreply.github.com> Date: Mon, 11 Mar 2024 11:02:24 +0530 Subject: [PATCH 3/6] few changes in COmmentsSection.tsx --- src/Components/Shifting/CommentsSection.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Components/Shifting/CommentsSection.tsx b/src/Components/Shifting/CommentsSection.tsx index c57229899d6..2b3a4a39837 100644 --- a/src/Components/Shifting/CommentsSection.tsx +++ b/src/Components/Shifting/CommentsSection.tsx @@ -28,7 +28,6 @@ const Comment = ({ const toggleExpanded = () => { setExpanded(!expanded); }; - const truncatedComment = comment.split(" ").slice(0, 20).join(" "); const remainingComment = comment.split(" ").slice(20).join(" "); From 48ce65759592b708b169f2995dae4a23b526d869 Mon Sep 17 00:00:00 2001 From: Thanush19 <110150744+Thanush19@users.noreply.github.com> Date: Mon, 11 Mar 2024 14:34:27 +0530 Subject: [PATCH 4/6] staged changes --- src/Components/Shifting/CommentsSection.tsx | 1 + src/Components/Users/models.tsx | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Shifting/CommentsSection.tsx b/src/Components/Shifting/CommentsSection.tsx index 2b3a4a39837..9b40b446f27 100644 --- a/src/Components/Shifting/CommentsSection.tsx +++ b/src/Components/Shifting/CommentsSection.tsx @@ -28,6 +28,7 @@ const Comment = ({ const toggleExpanded = () => { setExpanded(!expanded); }; + //refrained layout of const truncatedComment = comment.split(" ").slice(0, 20).join(" "); const remainingComment = comment.split(" ").slice(20).join(" "); diff --git a/src/Components/Users/models.tsx b/src/Components/Users/models.tsx index c31901b74ad..6908671edbe 100644 --- a/src/Components/Users/models.tsx +++ b/src/Components/Users/models.tsx @@ -45,7 +45,6 @@ export type UserModel = UserBareMinimum & { doctor_medical_council_registration?: string; weekly_working_hours?: string | null; }; - export interface SkillObjectModel { id: string; name: string; From a96a86be09f0381018bfdd843a72a93a2fa5ae92 Mon Sep 17 00:00:00 2001 From: Thanush19 <110150744+Thanush19@users.noreply.github.com> Date: Wed, 13 Mar 2024 11:49:01 +0530 Subject: [PATCH 5/6] Fix: Resolved stretching issue in the comment section on shifting detail page --- src/Components/Shifting/CommentsSection.tsx | 122 ++++++++++---------- src/Locale/en/Shifting.json | 4 +- src/Locale/kn/Shifting.json | 4 + src/Locale/kn/index.js | 2 + src/Locale/ml/Shifing.json | 4 + src/Locale/ml/index.js | 2 + src/Locale/mr/Shifting.json | 4 + src/Locale/mr/index.js | 2 + src/Locale/ta/Shifting.json | 4 + src/Locale/ta/index.js | 2 + 10 files changed, 87 insertions(+), 63 deletions(-) create mode 100644 src/Locale/kn/Shifting.json create mode 100644 src/Locale/ml/Shifing.json create mode 100644 src/Locale/mr/Shifting.json create mode 100644 src/Locale/ta/Shifting.json diff --git a/src/Components/Shifting/CommentsSection.tsx b/src/Components/Shifting/CommentsSection.tsx index 9b40b446f27..47731be5bce 100644 --- a/src/Components/Shifting/CommentsSection.tsx +++ b/src/Components/Shifting/CommentsSection.tsx @@ -9,68 +9,10 @@ import { IComment } from "../Resource/models"; import PaginatedList from "../../CAREUI/misc/PaginatedList"; import request from "../../Utils/request/request"; -interface CommentProps { +interface CommentSectionProps { id: string; - comment: string; - created_by_object: any; - modified_date: string; } - -const Comment = ({ - id, - comment, - created_by_object, - modified_date, -}: CommentProps) => { - const { t } = useTranslation(); - const [expanded, setExpanded] = useState(false); - - const toggleExpanded = () => { - setExpanded(!expanded); - }; - //refrained layout of - const truncatedComment = comment.split(" ").slice(0, 20).join(" "); - const remainingComment = comment.split(" ").slice(20).join(" "); - - return ( -
- {expanded ? comment : truncatedComment}
- {!expanded && remainingComment && (
-