From b4883d0ccc343d8fcd7c3f612ab907eb3640a473 Mon Sep 17 00:00:00 2001 From: George J Padayatti Date: Tue, 9 Apr 2024 22:33:22 +0530 Subject: [PATCH] Fix: Update texts Signed-off-by: George J Padayatti --- .../AddCredential/dataAttributeCardCredentials.tsx | 13 ++++++++++++- src/container/DDAgreements/ddaTable.jsx | 12 ++++++------ src/container/DDAgreements/index.tsx | 4 ++-- src/container/DDAgreements/listDDAModal.tsx | 14 +++++++------- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/container/AddCredential/dataAttributeCardCredentials.tsx b/src/container/AddCredential/dataAttributeCardCredentials.tsx index 1ca27ab..5c74c45 100644 --- a/src/container/AddCredential/dataAttributeCardCredentials.tsx +++ b/src/container/AddCredential/dataAttributeCardCredentials.tsx @@ -23,6 +23,17 @@ interface Props { export const DataAttributeCardForDDA = (props: Props) => { const { selectedData } = props; + const splitByDotAndGetLastWord = (text) => { + const parts = text.split("."); + const lastValue = parts[parts.length - 1]; + return lastValue + } + + const camelCaseToWords = (str) => { + const words = str.match(/[A-Z]*[^A-Z]+/g); + return words.map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' '); + }; + return ( { }} > - {attribute.attribute} + {camelCaseToWords(splitByDotAndGetLastWord(attribute.attribute))} {attribute.value} diff --git a/src/container/DDAgreements/ddaTable.jsx b/src/container/DDAgreements/ddaTable.jsx index d94e2fb..6212031 100644 --- a/src/container/DDAgreements/ddaTable.jsx +++ b/src/container/DDAgreements/ddaTable.jsx @@ -47,15 +47,15 @@ const DDAtable = ({ const getStatus = (status) => { if (status === "unlisted") { - return "Unlisted"; + return "Unlist"; } else if (status === "awaitingForApproval") { - return "In Review"; + return "Review"; } else if (status === "approved") { - return "Approved"; + return "Approve"; } else if (status === "rejected") { - return "Rejected"; + return "Reject"; } else if (status === "listed") { - return "Listed"; + return "List"; } }; @@ -89,7 +89,7 @@ const DDAtable = ({ }} > diff --git a/src/container/DDAgreements/index.tsx b/src/container/DDAgreements/index.tsx index eefdbb4..e6faae9 100644 --- a/src/container/DDAgreements/index.tsx +++ b/src/container/DDAgreements/index.tsx @@ -141,9 +141,9 @@ const DDAgreements = () => { - Status + Status Action: *