Skip to content

Commit 6d4ebf7

Browse files
authored
Merge pull request #882 from OpenSignLabs/raktima-opensignlabs-patch-10
fix: ui design of the share button in the in-progress report and various other UI issues.
2 parents 4fdf229 + 18992e0 commit 6d4ebf7

File tree

6 files changed

+75
-17
lines changed

6 files changed

+75
-17
lines changed

apps/OpenSign/src/components/sidebar/Sidebar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const Sidebar = ({ isOpen, closeSidebar }) => {
6363
};
6464
return (
6565
<aside
66-
className={`absolute lg:relative bg-base-100 h-screen overflow-y-auto transition-all z-[100] shadow-lg hide-scrollbar
66+
className={`absolute lg:relative bg-base-100 h-screen overflow-y-auto transition-all z-[999] shadow-lg hide-scrollbar
6767
${isOpen ? "w-full md:w-[300px]" : "w-0"}`}
6868
>
6969
<div className="flex px-2 py-3 gap-2 items-center shadow-md">

apps/OpenSign/src/pages/GenerateToken.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ function GenerateToken() {
135135
id="token"
136136
className={`${
137137
isSubscribe || !isEnableSubscription
138-
? "bg-white/20 pointer-events-none select-none"
139-
: ""
138+
? ""
139+
: "bg-white/20 pointer-events-none select-none"
140140
} md:text-end py-2 md:py-0`}
141141
>
142142
<span
@@ -146,7 +146,7 @@ function GenerateToken() {
146146
{apiToken ? apiToken : "_____"}
147147
</span>
148148
<button
149-
className="op-btn op-btn-accent op-btn-outline op-btn-sm ml-2"
149+
className="op-btn op-btn-accent op-btn-outline op-btn-sm ml-2 cursor-pointer"
150150
onClick={() => copytoclipboard(apiToken)}
151151
>
152152
<i className="fa-light fa-copy"></i>

apps/OpenSign/src/pages/PlaceHolderSign.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ import { EmailBody } from "../components/pdf/EmailBody";
4949
import Upgrade from "../primitives/Upgrade";
5050
import Alert from "../primitives/Alert";
5151
import Loader from "../primitives/Loader";
52-
import { DotLottieReact } from "@lottiefiles/dotlottie-react";
5352
import { useSelector } from "react-redux";
5453
import TextFontSetting from "../components/pdf/TextFontSetting";
5554
import PdfZoom from "../components/pdf/PdfZoom";
55+
import LottieWithLoader from "../primitives/DotLottieReact";
5656

5757
function PlaceHolderSign() {
5858
const editorRef = useRef();
@@ -1934,13 +1934,7 @@ function PlaceHolderSign() {
19341934
<div className="h-[100%] p-[20px]">
19351935
{mailStatus === "success" ? (
19361936
<div className="text-center mb-[10px]">
1937-
<DotLottieReact
1938-
dotLottieRefCallback={null}
1939-
src="https://lottie.host/00a72a09-f2d4-493a-9b2d-2843bf067638/Ic7jJ44wLJ.json"
1940-
autoplay
1941-
loop={false}
1942-
className="w-[120px] h-[120px] mx-auto"
1943-
/>
1937+
<LottieWithLoader />
19441938
<p>
19451939
You have successfully sent mails to all recipients!
19461940
</p>
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import React, { useState, useEffect } from "react";
2+
import { DotLottieReact } from "@lottiefiles/dotlottie-react";
3+
import Loader from "./Loader";
4+
5+
const LottieWithLoader = ({
6+
src = "https://lottie.host/00a72a09-f2d4-493a-9b2d-2843bf067638/Ic7jJ44wLJ.json",
7+
minLoaderTime = 1000,
8+
timeout = 10000
9+
}) => {
10+
const [isLoaded, setIsLoaded] = useState(false);
11+
const [hasError, setHasError] = useState(false);
12+
const [animationSrc, setAnimationSrc] = useState(null);
13+
14+
useEffect(() => {
15+
const timer = setTimeout(() => {
16+
setHasError(true);
17+
}, timeout);
18+
19+
fetch(src)
20+
.then((response) => {
21+
if (!response.ok) {
22+
throw new Error("Network response was not ok");
23+
}
24+
return response.blob();
25+
})
26+
.then((blob) => {
27+
const objectURL = URL.createObjectURL(blob);
28+
setAnimationSrc(objectURL);
29+
setTimeout(() => {
30+
setIsLoaded(true);
31+
}, minLoaderTime);
32+
})
33+
.catch((error) => {
34+
console.error("There was a problem with the fetch operation:", error);
35+
setHasError(true);
36+
});
37+
38+
return () => clearTimeout(timer);
39+
}, [src, minLoaderTime, timeout]);
40+
41+
return (
42+
<div>
43+
{!isLoaded && !hasError && (
44+
<div className="loader">
45+
{" "}
46+
<Loader />
47+
</div>
48+
)}
49+
{hasError && <div className="error">Failed to load animation</div>}
50+
{isLoaded && animationSrc && (
51+
<DotLottieReact
52+
src={animationSrc}
53+
loop
54+
autoplay
55+
style={{ display: "block" }}
56+
/>
57+
)}
58+
</div>
59+
);
60+
};
61+
62+
export default LottieWithLoader;

apps/OpenSign/src/primitives/GetReportDisplay.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,6 +1408,7 @@ const ReportTable = (props) => {
14081408
handleClose={() => {
14091409
setIsShare({});
14101410
setActLoader({});
1411+
setCopied(false);
14111412
}}
14121413
>
14131414
<div className="m-[20px]">
@@ -1416,22 +1417,23 @@ const ReportTable = (props) => {
14161417
key={i}
14171418
className="text-sm font-normal text-black flex my-2 justify-between items-center"
14181419
>
1419-
<span className="text-sm font-semibold">
1420+
<span className="w-[150px] mr-[5px] md:mr-0 md:w-[300px] whitespace-nowrap overflow-hidden text-ellipsis text-sm font-semibold">
14201421
{share.email}
14211422
</span>
1422-
<div>
1423+
<div className="flex items-center gap-2">
14231424
<RWebShare
14241425
data={{
14251426
url: share.url,
14261427
title: "Sign url"
14271428
}}
14281429
>
1429-
<button className="bg-[#002864] text-white rounded w-[32px] h-[30px] focus:outline-none">
1430+
<button className="op-btn op-btn-primary op-btn-outline op-btn-xs md:op-btn-sm ">
14301431
<i className="fa-light fa-share-from-square"></i>{" "}
1432+
Share
14311433
</button>
14321434
</RWebShare>
14331435
<button
1434-
className="ml-2 bg-[#002864] text-white rounded w-[100px] h-[30px] focus:outline-none"
1436+
className="op-btn op-btn-primary op-btn-outline op-btn-xs md:op-btn-sm"
14351437
onClick={() => copytoclipboard(share)}
14361438
>
14371439
<i className="fa-light fa-link"></i>{" "}

apps/OpenSign/src/primitives/PdfDeclineModal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function CustomModal({
1111
}) {
1212
return (
1313
show && (
14-
<dialog className="op-modal op-modal-open absolute z-[1999]">
14+
<dialog className="op-modal op-modal-open absolute z-[998]">
1515
<div className="w-[80%] md:w-[40%] op-modal-box p-0 overflow-y-auto hide-scrollbar text-sm">
1616
<h3 className="text-[#de4337] font-bold text-lg pt-[15px] px-[20px]">
1717
{headMsg && headMsg}

0 commit comments

Comments
 (0)