Skip to content

Commit b992d7d

Browse files
fix: change celebration effect and add for whole screen
1 parent ae740ef commit b992d7d

File tree

6 files changed

+51
-30
lines changed

6 files changed

+51
-30
lines changed

apps/OpenSign/package-lock.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/OpenSign/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"radix-ui": "^1.0.1",
1818
"react": "^18.2.0",
1919
"react-bootstrap": "^2.10.2",
20+
"react-confetti": "^6.1.0",
2021
"react-cookie": "^7.1.4",
2122
"react-datepicker": "^6.4.0",
2223
"react-dnd": "^16.0.1",

apps/OpenSign/src/components/pdf/EmailComponent.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ function EmailComponent({
1616
sender,
1717
setIsAlert,
1818
extUserId,
19-
activeMailAdapter,
20-
isEmailCelebration
19+
activeMailAdapter
2120
}) {
2221
const [emailList, setEmailList] = useState([]);
2322
const [emailValue, setEmailValue] = useState();
2423
const [isLoading, setIsLoading] = useState(false);
25-
const [isCelebration, setIsCelebration] = useState(false);
24+
const [isEmailCelebration, setIsEmailCelebration] = useState(false);
2625
//function for send email
2726
const sendEmail = async () => {
2827
setIsLoading(true);
@@ -63,9 +62,9 @@ function EmailComponent({
6362
" target=_blank>here</a> </p></div></div></body></html>"
6463
};
6564
sendMail = await axios.post(url, params, { headers: headers });
66-
setIsCelebration(true);
65+
setIsEmailCelebration(true);
6766
setTimeout(() => {
68-
setIsCelebration(false);
67+
setIsEmailCelebration(false);
6968
}, 3000);
7069
} catch (error) {
7170
console.log("error", error);
@@ -250,7 +249,7 @@ function EmailComponent({
250249
</div>
251250
</div>
252251
<div style={{ height: "100%", padding: 20 }}>
253-
{(isCelebration || isEmailCelebration) && (
252+
{isEmailCelebration && (
254253
<div className="absolute w-[100%] flex justify-center items-center">
255254
<img
256255
alt="print img"

apps/OpenSign/src/pages/PdfRequestFiles.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { useLocation, useNavigate, useParams } from "react-router-dom";
1111
import SignPad from "../components/pdf/SignPad";
1212
import RenderAllPdfPage from "../components/pdf/RenderAllPdfPage";
1313
import Tour from "reactour";
14+
import Confetti from "react-confetti";
1415
import moment from "moment";
1516
import {
1617
contractDocument,
@@ -260,9 +261,6 @@ function PdfRequestFiles() {
260261
};
261262
setAlreadySign(true);
262263
setIsCompleted(data);
263-
setTimeout(() => {
264-
setIsCelebration(false);
265-
}, 1500);
266264
} else if (declined) {
267265
const currentDecline = {
268266
currnt: "another",
@@ -429,6 +427,11 @@ function PdfRequestFiles() {
429427
message:
430428
"You have successfully signed the document. You can download or print a copy of the partially signed document. A copy of the digitally signed document will be sent to the owner over email once it is signed by all signers."
431429
});
430+
} else {
431+
setIsCelebration(true);
432+
setTimeout(() => {
433+
setIsCelebration(false);
434+
}, 2500);
432435
}
433436
}
434437

@@ -722,7 +725,6 @@ function PdfRequestFiles() {
722725
setSignedSigners([]);
723726
setUnSignedSigners([]);
724727
getDocumentDetails(true);
725-
setIsCelebration(true);
726728
const index = pdfDetails?.[0].Signers.findIndex(
727729
(x) => x.Email === jsonSender.email
728730
);
@@ -1182,6 +1184,14 @@ function PdfRequestFiles() {
11821184
</span>
11831185
</div>
11841186
)}
1187+
{isCelebration && (
1188+
<div style={{ position: "relative", zIndex: "1000" }}>
1189+
<Confetti
1190+
width={window.innerWidth}
1191+
height={window.innerHeight}
1192+
/>
1193+
</div>
1194+
)}
11851195

11861196
<div
11871197
className="relative flex flex-col md:flex-row justify-between bg-[#ebebeb]"
@@ -1371,7 +1381,6 @@ function PdfRequestFiles() {
13711381
handleClose={() => {
13721382
setIsCompleted((prev) => ({ ...prev, isModal: false }));
13731383
}}
1374-
isCelebration={!isCompleted?.message && isCelebration}
13751384
>
13761385
<div style={{ height: "100%", padding: 20 }}>
13771386
<p>

apps/OpenSign/src/pages/SignyourselfPdf.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { PDFDocument } from "pdf-lib";
33
import "../styles/signature.css";
44
import Parse from "parse";
55
import { isEnableSubscription, themeColor } from "../constant/const";
6+
import Confetti from "react-confetti";
67
import axios from "axios";
78
import Loader from "../primitives/LoaderWithMsg";
89
import loader from "../assets/images/loader2.gif";
@@ -108,7 +109,7 @@ function SignYourSelf() {
108109
const [isDontShow, setIsDontShow] = useState(false);
109110
const [extUserId, setExtUserId] = useState("");
110111
const [isCompleted, setIsCompleted] = useState(false);
111-
const [isCompletionCeleb, setIsCompletionCeleb] = useState(false);
112+
const [isCelebration, setIsCelebration] = useState(false);
112113
const [pdfArrayBuffer, setPdfArrayBuffer] = useState("");
113114
const [activeMailAdapter, setActiveMailAdapter] = useState("");
114115
const [isEmailVerified, setIsEmailVerified] = useState(true);
@@ -229,11 +230,12 @@ function SignYourSelf() {
229230
setIsUiLoading(false);
230231
setIsSignPad(false);
231232
setIsEmail(true);
233+
setIsCelebration(true);
232234
setXyPostion([]);
233235
setSignBtnPosition([]);
234236
setTimeout(() => {
235-
setIsCompletionCeleb(false);
236-
}, 1500);
237+
setIsCelebration(false);
238+
}, 2500);
237239
}
238240
}
239241
} else if (
@@ -768,7 +770,6 @@ function SignYourSelf() {
768770
setPdfUrl(json.result.data);
769771
if (json.result.data) {
770772
getDocumentDetails(false);
771-
setIsCompletionCeleb(true);
772773
}
773774
})
774775
.catch((err) => {
@@ -1122,6 +1123,11 @@ function SignYourSelf() {
11221123
</span>
11231124
</div>
11241125
)}
1126+
{isCelebration && (
1127+
<div style={{ position: "relative", zIndex: "999" }}>
1128+
<Confetti width={window.innerWidth} height={window.innerHeight} />
1129+
</div>
1130+
)}
11251131

11261132
<div className="signatureContainer" ref={divRef}>
11271133
{!isEmailVerified && (
@@ -1265,8 +1271,6 @@ function SignYourSelf() {
12651271
setIsAlert={setIsAlert}
12661272
extUserId={extUserId}
12671273
activeMailAdapter={activeMailAdapter}
1268-
isEmailCelebration={isCompletionCeleb}
1269-
setIsCompletionCeleb={setIsCompletionCeleb}
12701274
/>
12711275
{/* pdf header which contain funish back button */}
12721276
<Header

apps/OpenSign/src/primitives/ModalUi.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from "react";
22
import { isEnableSubscription } from "../constant/const";
33
import PremiumAlertHeader from "./PremiumAlertHeader";
4-
import celebration from "../assets/images/newCeleb.gif";
54

65
const ModalUi = ({
76
children,
@@ -12,8 +11,7 @@ const ModalUi = ({
1211
showHeader = true,
1312
showClose = true,
1413
styleClass,
15-
showHeaderMessage,
16-
isCelebration
14+
showHeaderMessage
1715
}) => {
1816
return (
1917
<>
@@ -26,16 +24,6 @@ const ModalUi = ({
2624
: "fixed z-[1000] top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-sm bg-white rounded shadow-md max-h-90 min-w-[90%] md:min-w-[500px] overflow-y-auto hide-scrollbar"
2725
}
2826
>
29-
{isCelebration && (
30-
<div className="absolute w-[100%] flex justify-center items-center">
31-
<img
32-
alt="print img"
33-
width={300}
34-
height={100}
35-
src={celebration}
36-
/>
37-
</div>
38-
)}
3927
{showHeader && (
4028
<div
4129
className="flex justify-between rounded-t items-center py-[15px] px-[20px] text-white"

0 commit comments

Comments
 (0)