Skip to content

Commit

Permalink
Merge pull request #882 from OpenSignLabs/raktima-opensignlabs-patch-10
Browse files Browse the repository at this point in the history
fix: ui design of the share button in the in-progress report and various other UI issues.
  • Loading branch information
nxglabs committed Jun 26, 2024
2 parents 4fdf229 + 18992e0 commit 6d4ebf7
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 17 deletions.
2 changes: 1 addition & 1 deletion apps/OpenSign/src/components/sidebar/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Sidebar = ({ isOpen, closeSidebar }) => {
};
return (
<aside
className={`absolute lg:relative bg-base-100 h-screen overflow-y-auto transition-all z-[100] shadow-lg hide-scrollbar
className={`absolute lg:relative bg-base-100 h-screen overflow-y-auto transition-all z-[999] shadow-lg hide-scrollbar
${isOpen ? "w-full md:w-[300px]" : "w-0"}`}
>
<div className="flex px-2 py-3 gap-2 items-center shadow-md">
Expand Down
6 changes: 3 additions & 3 deletions apps/OpenSign/src/pages/GenerateToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ function GenerateToken() {
id="token"
className={`${
isSubscribe || !isEnableSubscription
? "bg-white/20 pointer-events-none select-none"
: ""
? ""
: "bg-white/20 pointer-events-none select-none"
} md:text-end py-2 md:py-0`}
>
<span
Expand All @@ -146,7 +146,7 @@ function GenerateToken() {
{apiToken ? apiToken : "_____"}
</span>
<button
className="op-btn op-btn-accent op-btn-outline op-btn-sm ml-2"
className="op-btn op-btn-accent op-btn-outline op-btn-sm ml-2 cursor-pointer"
onClick={() => copytoclipboard(apiToken)}
>
<i className="fa-light fa-copy"></i>
Expand Down
10 changes: 2 additions & 8 deletions apps/OpenSign/src/pages/PlaceHolderSign.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ import { EmailBody } from "../components/pdf/EmailBody";
import Upgrade from "../primitives/Upgrade";
import Alert from "../primitives/Alert";
import Loader from "../primitives/Loader";
import { DotLottieReact } from "@lottiefiles/dotlottie-react";
import { useSelector } from "react-redux";
import TextFontSetting from "../components/pdf/TextFontSetting";
import PdfZoom from "../components/pdf/PdfZoom";
import LottieWithLoader from "../primitives/DotLottieReact";

function PlaceHolderSign() {
const editorRef = useRef();
Expand Down Expand Up @@ -1934,13 +1934,7 @@ function PlaceHolderSign() {
<div className="h-[100%] p-[20px]">
{mailStatus === "success" ? (
<div className="text-center mb-[10px]">
<DotLottieReact
dotLottieRefCallback={null}
src="https://lottie.host/00a72a09-f2d4-493a-9b2d-2843bf067638/Ic7jJ44wLJ.json"
autoplay
loop={false}
className="w-[120px] h-[120px] mx-auto"
/>
<LottieWithLoader />
<p>
You have successfully sent mails to all recipients!
</p>
Expand Down
62 changes: 62 additions & 0 deletions apps/OpenSign/src/primitives/DotLottieReact.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React, { useState, useEffect } from "react";
import { DotLottieReact } from "@lottiefiles/dotlottie-react";
import Loader from "./Loader";

const LottieWithLoader = ({
src = "https://lottie.host/00a72a09-f2d4-493a-9b2d-2843bf067638/Ic7jJ44wLJ.json",
minLoaderTime = 1000,
timeout = 10000
}) => {
const [isLoaded, setIsLoaded] = useState(false);
const [hasError, setHasError] = useState(false);
const [animationSrc, setAnimationSrc] = useState(null);

useEffect(() => {
const timer = setTimeout(() => {
setHasError(true);
}, timeout);

fetch(src)
.then((response) => {
if (!response.ok) {
throw new Error("Network response was not ok");
}
return response.blob();
})
.then((blob) => {
const objectURL = URL.createObjectURL(blob);
setAnimationSrc(objectURL);
setTimeout(() => {
setIsLoaded(true);
}, minLoaderTime);
})
.catch((error) => {
console.error("There was a problem with the fetch operation:", error);
setHasError(true);
});

return () => clearTimeout(timer);
}, [src, minLoaderTime, timeout]);

return (
<div>
{!isLoaded && !hasError && (
<div className="loader">
{" "}
<Loader />
</div>
)}
{hasError && <div className="error">Failed to load animation</div>}
{isLoaded && animationSrc && (
<DotLottieReact
src={animationSrc}
loop
autoplay
style={{ display: "block" }}
/>
)}
</div>
);
};

export default LottieWithLoader;
10 changes: 6 additions & 4 deletions apps/OpenSign/src/primitives/GetReportDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -1408,6 +1408,7 @@ const ReportTable = (props) => {
handleClose={() => {
setIsShare({});
setActLoader({});
setCopied(false);
}}
>
<div className="m-[20px]">
Expand All @@ -1416,22 +1417,23 @@ const ReportTable = (props) => {
key={i}
className="text-sm font-normal text-black flex my-2 justify-between items-center"
>
<span className="text-sm font-semibold">
<span className="w-[150px] mr-[5px] md:mr-0 md:w-[300px] whitespace-nowrap overflow-hidden text-ellipsis text-sm font-semibold">
{share.email}
</span>
<div>
<div className="flex items-center gap-2">
<RWebShare
data={{
url: share.url,
title: "Sign url"
}}
>
<button className="bg-[#002864] text-white rounded w-[32px] h-[30px] focus:outline-none">
<button className="op-btn op-btn-primary op-btn-outline op-btn-xs md:op-btn-sm ">
<i className="fa-light fa-share-from-square"></i>{" "}
Share
</button>
</RWebShare>
<button
className="ml-2 bg-[#002864] text-white rounded w-[100px] h-[30px] focus:outline-none"
className="op-btn op-btn-primary op-btn-outline op-btn-xs md:op-btn-sm"
onClick={() => copytoclipboard(share)}
>
<i className="fa-light fa-link"></i>{" "}
Expand Down
2 changes: 1 addition & 1 deletion apps/OpenSign/src/primitives/PdfDeclineModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function CustomModal({
}) {
return (
show && (
<dialog className="op-modal op-modal-open absolute z-[1999]">
<dialog className="op-modal op-modal-open absolute z-[998]">
<div className="w-[80%] md:w-[40%] op-modal-box p-0 overflow-y-auto hide-scrollbar text-sm">
<h3 className="text-[#de4337] font-bold text-lg pt-[15px] px-[20px]">
{headMsg && headMsg}
Expand Down

0 comments on commit 6d4ebf7

Please sign in to comment.