From 4f238f4a6f6b1824d7a47f1c3c210f31a8e7c683 Mon Sep 17 00:00:00 2001 From: JaiPandey425 Date: Mon, 1 Sep 2025 14:05:38 +0530 Subject: [PATCH] respo mob --- .../process/processStepOne/ProcessStepOne.tsx | 88 +++--- .../processStepOne/RecipientAddCard.tsx | 217 ++++++------- .../process/processStepOne/RecipientCards.tsx | 147 +++++---- .../processStepOne/SelectedDocuments.tsx | 296 +++++++++--------- 4 files changed, 398 insertions(+), 350 deletions(-) diff --git a/src/components/process/processStepOne/ProcessStepOne.tsx b/src/components/process/processStepOne/ProcessStepOne.tsx index 0b3dbe0..3a2bbbb 100644 --- a/src/components/process/processStepOne/ProcessStepOne.tsx +++ b/src/components/process/processStepOne/ProcessStepOne.tsx @@ -193,7 +193,7 @@ const ProcessStepOne = () => { // minRoutingOrder = recipient.routingOrder ?? 1; // } // }); - + const recipientsData = selectedRecipients.map((recipient, index) => ({ id: "id" in recipient ? recipient.id : null, routingOrder: "routingOrder" in recipient && recipient.routingOrder ? recipient.routingOrder : 1, @@ -267,7 +267,7 @@ const ProcessStepOne = () => { } } else { - if(!accountId || !transactionId) return; + if (!accountId || !transactionId) return; dispatch(addRecipientAsync({ recipientsData: recipientsDataTemp, accountId, transactionId })); } dispatch(showLoader("Processing Message...")); @@ -345,50 +345,60 @@ const ProcessStepOne = () => {
{/* Top Navigation - Fixed */} -
-
- -

- {transactionTemplateToggle === TRANSACTION_TEMPLATE_TOGGLE.TEMPLATES ? - <> - - {!isTyping && ( - - )} - : - "Add Recipient and Message" - } -

-
+
+
-
+ {/* Left Section */} +
- {transactionTemplateToggle === TRANSACTION_TEMPLATE_TOGGLE.TEMPLATES && } + - +

+ {transactionTemplateToggle === TRANSACTION_TEMPLATE_TOGGLE.TEMPLATES ? ( + <> + + {!isTyping && ( + + )} + + ) : ( + "Add Recipient and Message" + )} +

+
+ {/* Right Section */} +
+ + {transactionTemplateToggle === TRANSACTION_TEMPLATE_TOGGLE.TEMPLATES && ( + + )} + + +
+ {/* Main Content - Scrollable */}
diff --git a/src/components/process/processStepOne/RecipientAddCard.tsx b/src/components/process/processStepOne/RecipientAddCard.tsx index 4ce3cf0..3325f97 100644 --- a/src/components/process/processStepOne/RecipientAddCard.tsx +++ b/src/components/process/processStepOne/RecipientAddCard.tsx @@ -363,27 +363,26 @@ const RecipientAddCard = ({ transactionTemplateToggle, editRecipient, editCase, - return ( + return (
{transactionTemplateToggle === TRANSACTION_TEMPLATE_TOGGLE.TEMPLATES && ( -
- {/* Top Row: Role Input + Settings */} -
+
+ {/* Role Name and Permissions Section - Responsive Layout */} +
{/* Role Name Input */} - {/* Role Name Input */} -
+
{ setRecipients({ ...recipient, roleName: e.target.value }); setErrors(prev => ({ ...prev, roleName: false })); @@ -394,95 +393,76 @@ const RecipientAddCard = ({ transactionTemplateToggle, editRecipient, editCase, )}
+ {/* Permissions Section */} +
+
+ {/* Edit Permission */} +
+ +
- {/* Settings + Permissions */} -
-
- {/* Permission Status Text - Always Visible */} - - {/* Permission Controls - Always Visible */} -
-
- {/* Edit Permission */} -
- - {/* Tooltip */} - -
- - {/* Delete Permission */} -
- - {/* Tooltip */} - {/*
-
- Delete Permission -
-
-
*/} -
-
+ {/* Delete Permission */} +
+
-
)} - {/* Name Inputs */} -
-
+ {/* Name and Email Inputs - Responsive Grid */} +
+ {/* First Name */} +
handleFocus("firstName")} onBlur={handleContactModalBlur} value={recipient.firstName} placeholder="First Name" - className={`w-full px-4 py-2 border rounded-md text-sm focus:outline-none transition - ${errors.firstName ? 'border-red-500 ring-2 ring-red-300' : 'border-gray-300 focus:ring-2 focus:ring-[var(--primary)]'}`} + className={`w-full px-3 sm:px-4 py-2 border rounded-md text-sm focus:outline-none transition + ${errors.firstName ? 'border-red-500 ring-2 ring-red-300' : 'border-gray-300 focus:ring-2 focus:ring-[var(--primary)]'}`} onChange={(e) => { setRecipients({ ...recipient, firstName: e.target.value }); - // setErrors((prev) => ({ ...prev, firstName: false })); }} />
- {/* {errors.firstName && ( -

First Name is required

- )} */} -
+ + {/* Last Name */} +
handleFocus("lastName")} onBlur={handleContactModalBlur} value={recipient.lastName} placeholder="Last Name" - className={` w-full px-4 py-2 border rounded-md text-sm focus:outline-none transition - ${errors.lastName ? 'border-red-500 ring-2 ring-red-300' : 'border-gray-300 focus:ring-2 focus:ring-[var(--primary)]'}`} + className={`w-full px-3 sm:px-4 py-2 border rounded-md text-sm focus:outline-none transition + ${errors.lastName ? 'border-red-500 ring-2 ring-red-300' : 'border-gray-300 focus:ring-2 focus:ring-[var(--primary)]'}`} onChange={(e) => { setRecipients({ ...recipient, lastName: e.target.value }); setErrors((prev) => ({ ...prev, lastName: false })); @@ -492,15 +472,17 @@ const RecipientAddCard = ({ transactionTemplateToggle, editRecipient, editCase,

Last Name is required

)}
-
+ + {/* Email - Full width on small screens, shares row on larger */} +
handleFocus("email")} onBlur={handleContactModalBlur} value={recipient.email} placeholder="Recipient Email" - className={`w-full px-4 py-2 border rounded-md text-sm focus:outline-none transition - ${errors.email ? 'border-red-500 ring-2 ring-red-300' : 'border-gray-300 focus:ring-2 focus:ring-[var(--primary)]'}`} + className={`w-full px-3 sm:px-4 py-2 border rounded-md text-sm focus:outline-none transition + ${errors.email ? 'border-red-500 ring-2 ring-red-300' : 'border-gray-300 focus:ring-2 focus:ring-[var(--primary)]'}`} onChange={(e) => { setRecipients({ ...recipient, email: e.target.value }); setErrors((prev) => ({ ...prev, email: false })); @@ -512,33 +494,35 @@ const RecipientAddCard = ({ transactionTemplateToggle, editRecipient, editCase,
+ {/* Host Fields for In-Person Signers */} + {recipient.type === recipientType.INPERSONSIGNER && ( +
+ setOpenContactModal(true)} + onBlur={handleContactModalBlur} + value={recipient.hostName} + placeholder="Host Name" + className="w-full px-3 sm:px-4 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-[var(--primary)] transition" + onChange={(e) => setRecipients({ ...recipient, hostName: e.target.value })} + /> + setOpenContactModal(true)} + onBlur={handleContactModalBlur} + value={recipient.hostEmail} + placeholder="Host Email" + className="w-full px-3 sm:px-4 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-[var(--primary)] transition" + onChange={(e) => setRecipients({ ...recipient, hostEmail: e.target.value })} + /> +
+ )} - {recipient.type === recipientType.INPERSONSIGNER &&
- setOpenContactModal(true)} - onBlur={handleContactModalBlur} - value={recipient.hostName} - placeholder="Host Name" - className="w-full px-4 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-[var(--primary)] transition" - onChange={(e) => setRecipients({ ...recipient, hostName: e.target.value })} - /> - setOpenContactModal(true)} - onBlur={handleContactModalBlur} - value={recipient.hostEmail} - placeholder="Host Email" - className="w-full px-4 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-[var(--primary)] transition" - onChange={(e) => setRecipients({ ...recipient, hostEmail: e.target.value })} - /> -
} - - {/* Contact Modal */} + {/* Contact Modal - Responsive Positioning */} {openContactModal && contactData.contacts.length > 0 && ( -
+
)} - - - {/* Signing options + Add button in one line */} -
-
+ {/* Signing Options and Add Button - Responsive Layout */} +
+ {/* Recipient Type Radio Options */} +
{[ { label: "Signer", value: recipientType.SIGNER }, { label: "In Person Signer", value: recipientType.INPERSONSIGNER }, { label: "CC", value: recipientType.CC }, ].map((option) => ( -
- {!showCard && } + {/* Add/Edit Button */} + {!showCard && ( + + )}
diff --git a/src/components/process/processStepOne/RecipientCards.tsx b/src/components/process/processStepOne/RecipientCards.tsx index 608257e..aa0626b 100644 --- a/src/components/process/processStepOne/RecipientCards.tsx +++ b/src/components/process/processStepOne/RecipientCards.tsx @@ -121,7 +121,7 @@ const RecipientCards = ({ return currentValue && currentValue.toString().trim() !== ""; }; - const renderEditableField = ( + const renderEditableField = ( recipient: any, fieldName: string, placeholder: string, @@ -134,7 +134,7 @@ const RecipientCards = ({ const editable = isEditable(recipient); return ( -
+
@@ -215,17 +215,17 @@ const RecipientCards = ({ setEditingField(null); }; - return ( + return (
{recipients.length > 0 ? ( <> {recipients.length > 1 && ( -
+

Recipients ({recipients.length})