Sign Button Remove Asyn | Add Loader | Added Decline Reason in Transaction View | ... 08-10
This commit is contained in:
parent
d4b42d3b11
commit
cf7a516d38
File diff suppressed because it is too large
Load Diff
|
|
@ -28,6 +28,7 @@ interface NavTwoProps {
|
||||||
isPreview?: boolean
|
isPreview?: boolean
|
||||||
aId?: string | null
|
aId?: string | null
|
||||||
tId?: string | null
|
tId?: string | null
|
||||||
|
onSendClick?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -65,7 +66,8 @@ const NavTwo: React.FC<NavTwoProps> = ({
|
||||||
setIsSend,
|
setIsSend,
|
||||||
isPreview = false,
|
isPreview = false,
|
||||||
aId = null,
|
aId = null,
|
||||||
tId = null
|
tId = null,
|
||||||
|
onSendClick,
|
||||||
}) => {
|
}) => {
|
||||||
let transactionTemplateToggle = TRANSACTION_TEMPLATE_TOGGLE.TRANSACTIONS;
|
let transactionTemplateToggle = TRANSACTION_TEMPLATE_TOGGLE.TRANSACTIONS;
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
@ -175,55 +177,25 @@ const NavTwo: React.FC<NavTwoProps> = ({
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSend === null) {
|
// if (isSend === null) {
|
||||||
setIsSend(false);
|
// setIsSend(false);
|
||||||
}
|
// }
|
||||||
setIsSend(!isSend);
|
// setIsSend(!isSend);
|
||||||
|
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
if (transactionTemplateToggle === TRANSACTION_TEMPLATE_TOGGLE.TRANSACTIONS) {
|
if (transactionTemplateToggle === TRANSACTION_TEMPLATE_TOGGLE.TRANSACTIONS) {
|
||||||
if (isSignSend) {
|
if (isSignSend) {
|
||||||
window.open(`./../../../sign/${selfUserSign.recipientId}`, "_self");
|
window.open(`./../../../sign/${selfUserSign.recipientId}`, "_self");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
navigate(`/transaction-sent/${accountId}/${transactionId}`, { replace: true })
|
onSendClick();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
navigate(`/templates`);
|
navigate(`/templates`);
|
||||||
// toast.success("Template Saved...!", {
|
|
||||||
// position: "top-center",
|
|
||||||
// autoClose: 1500,
|
|
||||||
// hideProgressBar: false,
|
|
||||||
// closeOnClick: false,
|
|
||||||
// pauseOnHover: true,
|
|
||||||
// draggable: true,
|
|
||||||
// progress: undefined,
|
|
||||||
// theme: "light",
|
|
||||||
// transition: Bounce,
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
}, 1000)
|
// }, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// const handleSetIsFields = (setTo: boolean) => {
|
|
||||||
// if (setTo !== undefined && setTo !== isFields) {
|
|
||||||
// setIsFields(setTo)
|
|
||||||
// if(setTo === true) {
|
|
||||||
// setIsPages(false)
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const handleSetIsPages = (setTo: boolean) => {
|
|
||||||
// if (setTo !== undefined && setTo !== isPages) {
|
|
||||||
// setIsPages(setTo)
|
|
||||||
// if(setTo === true) {
|
|
||||||
// setIsFields(false)
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
|
|
||||||
const zoom = (percentage: number, contentClass: string) => {
|
const zoom = (percentage: number, contentClass: string) => {
|
||||||
const content = document.querySelector(`.${contentClass}`);
|
const content = document.querySelector(`.${contentClass}`);
|
||||||
if (content) {
|
if (content) {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useRef, useState } from 'react'
|
||||||
|
|
||||||
import NavTwo from './NavTwo';
|
import NavTwo from './NavTwo';
|
||||||
import LeftSideBar from './LeftSideBar';
|
import LeftSideBar from './LeftSideBar';
|
||||||
import DocumentContainer from './DocumentContainer';
|
import DocumentContainer, { DocumentContainerRef } from './DocumentContainer';
|
||||||
|
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { RootState } from '../../../store/store';
|
import { RootState } from '../../../store/store';
|
||||||
|
|
@ -48,21 +48,27 @@ const ProcessStepTwo = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSetIsPages = (setTo: boolean) => {
|
const handleSetIsPages = (setTo: boolean) => {
|
||||||
if (setTo !== undefined && setTo !== isPages) {
|
if (setTo !== undefined && setTo !== isPages) {
|
||||||
setIsPages(setTo)
|
setIsPages(setTo)
|
||||||
if(setTo === true) {
|
if (setTo === true) {
|
||||||
setIsFields(false)
|
setIsFields(false)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const docRef = useRef<DocumentContainerRef>(null);
|
||||||
|
|
||||||
|
const handleSendClick = () => {
|
||||||
|
docRef.current?.handleTransactionProcess();
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`min-w-full relative h-screen bg-slate-100 overflow-hidden ${(globalLoader.isLoading) ? 'pointer-events-none' : ''}`}>
|
<div className={`min-w-full relative h-screen bg-slate-100 overflow-hidden ${(globalLoader.isLoading) ? 'pointer-events-none' : ''}`}>
|
||||||
<NavTwo transactionSaving={transactionSaving} isFields={isFields} isPages={isPages} setIsPages={setIsPages} setIsFields={setIsFields} isSend={isSend} setIsSend={setIsSend} />
|
<NavTwo transactionSaving={transactionSaving} isFields={isFields} isPages={isPages} setIsPages={setIsPages} setIsFields={setIsFields} isSend={isSend} setIsSend={setIsSend} onSendClick={handleSendClick} />
|
||||||
|
|
||||||
<div className='sm:grid sm:grid-cols-12 sm:gap-1 mt-1 h-[calc(100vh-46px)] overflow-hidden'>
|
<div className='sm:grid sm:grid-cols-12 sm:gap-1 mt-1 h-[calc(100vh-46px)] overflow-hidden'>
|
||||||
<LeftSideBar isFields={isFields} isPages={isPages} selectedRecipientIndx={selectedRecipient} setSelectedRecipient={setSelectedRecipient} handleSetIsFields={handleSetIsFields} handleSetIsPages={handleSetIsPages} />
|
<LeftSideBar isFields={isFields} isPages={isPages} selectedRecipientIndx={selectedRecipient} setSelectedRecipient={setSelectedRecipient} handleSetIsFields={handleSetIsFields} handleSetIsPages={handleSetIsPages} />
|
||||||
<DocumentContainer transactionSaving={transactionSaving} setTransactionSaving={setTransactionSaving} isSend={isSend} setIsSend={setIsSend} />
|
<DocumentContainer ref={docRef} transactionSaving={transactionSaving} setTransactionSaving={setTransactionSaving} isSend={isSend} setIsSend={setIsSend} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{globalLoader.isLoading && <Loader />}
|
{globalLoader.isLoading && <Loader />}
|
||||||
|
|
|
||||||
|
|
@ -205,6 +205,9 @@ const TransactionView = () => {
|
||||||
{"message" in recipient && <p className="text-xs text-gray-500 italic">
|
{"message" in recipient && <p className="text-xs text-gray-500 italic">
|
||||||
{recipient.message}
|
{recipient.message}
|
||||||
</p>}
|
</p>}
|
||||||
|
{"declineReason" in recipient && <p className="text-xs text-gray-500 italic">
|
||||||
|
{recipient.declineReason}
|
||||||
|
</p>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue