diff --git a/src/App.tsx b/src/App.tsx index c7efee9..c055852 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -26,6 +26,7 @@ import Account from "./components/accounts/Account"; import TransactionView from "./components/transactions/TransactionView"; import AccountTransactionWrapper from "./components/AccountTransactionWrapper"; import SigningOrderDiagram from "./SigningOrderDiagram "; +import Templates from "./components/templates/Templates"; const App = () => { return ( @@ -41,7 +42,7 @@ const App = () => { }> } /> - } /> + } /> {/* } /> */} }> diff --git a/src/components/process/processStepOne/RecipientAddCard.tsx b/src/components/process/processStepOne/RecipientAddCard.tsx index a31a88b..3b734a7 100644 --- a/src/components/process/processStepOne/RecipientAddCard.tsx +++ b/src/components/process/processStepOne/RecipientAddCard.tsx @@ -32,7 +32,7 @@ const RecipientAddCard = () => { const handleRecipientAdd = (e: React.FormEvent) => { e.preventDefault(); - if (recipient.firstName === "" || recipient.lastName === "" || recipient.email === "" || !recipient.type) return; + if (recipient.lastName === "" || recipient.email === "" || !recipient.type) return; // Validate Email Format const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; @@ -106,7 +106,7 @@ const RecipientAddCard = () => { {/* Name Inputs */}
setOpenContactModal(true)} onBlur={handleContactModalBlur} diff --git a/src/components/process/processStepTwo/DocumentContainer.tsx b/src/components/process/processStepTwo/DocumentContainer.tsx index 03db2a8..7ca54d8 100644 --- a/src/components/process/processStepTwo/DocumentContainer.tsx +++ b/src/components/process/processStepTwo/DocumentContainer.tsx @@ -14,6 +14,7 @@ import { fetchRecipients } from '../../../store/slices/selectedRecipientsSlice'; import { fetchDocuments } from '../../../store/slices/documentSlice'; import { FaQuestionCircle } from 'react-icons/fa'; import typeToIconMap from '../../../helper/iconMap'; +import { IoAdd } from 'react-icons/io5'; export interface DroppedItemsObj { [key: string]: DroppedItem[] @@ -210,12 +211,12 @@ const DocumentContainer: React.FC = ({ isSend }) => { "dimensions": dropTag.dimensions, "type": dropTag.type.toUpperCase(), // "subType": (dropTag.subType ? dropTag.subType.toUpperCase() : null), - validation: { - "minLength": 0, - "maxLength": 0, - "error": ("error" in dropTag && dropTag.error) ? `${dropTag.error}`.toUpperCase() : "error", - "regex": "regex" in dropTag ? dropTag.regex : [] - }, + // validation: { + "minLength": 0, + "maxLength": 0, + "error": ("error" in dropTag && dropTag.error) ? `${dropTag.error}`.toUpperCase() : "error", + "regex": "regex" in dropTag ? dropTag.regex : [], + // }, "documentId": dropTag.documentId, "options": ("options" in dropTag) ? dropTag.options : [], "pageIndex": dropTag.pageIndex, @@ -275,10 +276,10 @@ const DocumentContainer: React.FC = ({ isSend }) => { tagsData = groupByRecipientId(tagsData); sendTagsToRecipients(tagsData, accountId, transactionId); - // (async () => { - // const res = await api.put(`/api/accounts/${accountId}/transactions/${transactionId}`, {status: "SENT"}) - // console.log(res, "Check123") - // })() + (async () => { + const res = await api.put(`/api/accounts/${accountId}/transactions/${transactionId}`, {status: "SENT"}) + console.log(res, "Check123") + })() }, [isSend]) // Save Tags - END @@ -519,6 +520,11 @@ const DocumentContainer: React.FC = ({ isSend }) => { })() } + const handleAddRadioClick = (key:string) => { + console.log("Handle Radio Clicled", key) + console.log(droppedItems, "line 525") + } + // const handleAddRadio = (e: React.MouseEvent, key: string, index: number) => { // // const dataToSet: DroppedItemsObj = { // // ...droppedItems, @@ -698,21 +704,53 @@ const DocumentContainer: React.FC = ({ isSend }) => { {/* Expand Circle - ENDS */} + { + item.type !== "radio" ? +
handleTagMouseDown(e, key, index)} + // style={{ width: `${item.width}px !important` }} + className='p-2 rounded-sm h-full shadow opacity-40 cursor-grab w-full' + style={{ background: selectedRecipient[0]?.color }} + > +

+ {IconComponent} +

+
+ : + <> +
+ {/* Radio - Container - START */} +
-
handleTagMouseDown(e, key, index)} - // style={{ width: `${item.width}px !important` }} - className='p-2 rounded-sm h-full shadow opacity-40 cursor-grab w-full' - style={{ background: selectedRecipient[0]?.color }} - > -

- {IconComponent} -

-
+ {/* Radio- Item - START */} +
handleTagMouseDown(e, key, index)} + // style={{ width: `${item.width}px !important` }} + className='p-2 rounded-sm h-full shadow opacity-40 cursor-grab w-full' + style={{ background: selectedRecipient[0]?.color }} + > +

+ {IconComponent} +

+
+ {/* Radio- Item - END */} +
+ {/* Radio - Container - END */} + + + handleAddRadioClick(key)} className='ml-[50%] translate-x-[-50%] cursor-pointer' /> +
+ + + + }
) } diff --git a/src/components/templates/Templates.tsx b/src/components/templates/Templates.tsx new file mode 100644 index 0000000..3881284 --- /dev/null +++ b/src/components/templates/Templates.tsx @@ -0,0 +1,9 @@ +import React from 'react' + +const Templates = () => { + return ( +
Templates
+ ) +} + +export default Templates \ No newline at end of file diff --git a/src/config/api.tsx b/src/config/api.tsx index bdfb4f3..0d90aa8 100644 --- a/src/config/api.tsx +++ b/src/config/api.tsx @@ -29,7 +29,7 @@ api.interceptors.response.use( const originalRequest = error.config; // Prevent multiple refresh attempts // if (error.response?.status === 401 || error.response?.status === 500) { - if (error.response?.status === 401) { + if (error.response?.status === 401 || error.response?.status === 500) { originalRequest._retry = true; try { if (!isRefreshing) { diff --git a/vite.config.ts b/vite.config.ts index 4a95a51..70397db 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -11,7 +11,8 @@ export default defineConfig({ 'quality-friendly-goldfish.ngrok-free.app', 'officially-powerful-goat.ngrok-free.app', '89f0-49-36-189-120.ngrok-free.app', - 'c8ee-49-36-191-130.ngrok-free.app' + 'c8ee-49-36-191-130.ngrok-free.app', + 'c76f1251c173.ngrok-free.app' ], }, build: {